[mapguide-users] react-layout: Hooking to events in the AJAX viewer (OnSelectionChanged)

2017-02-28 Thread Matze
Hi,
is there a way in react-layout (v0.8 Ajax Viewer) to rebuild the 
OnSelectionChanged/onMapClick workaround

  
like in the normal MapGuide Ajax Viewer?

Thank you in advanced. 








--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/react-layout-Hooking-to-events-in-the-AJAX-viewer-OnSelectionChanged-tp5309934.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] react-layout: Hooking to events in the AJAX viewer (OnSelectionChanged)

2017-02-28 Thread Jackie Ng
There is no current hook to the outside (of react.js) world for map selection
changes.

It should be trivial for me to add such a hook as a mount() call option if
that is what you're after.

- Jackie



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/react-layout-Hooking-to-events-in-the-AJAX-viewer-OnSelectionChanged-tp5309934p5309941.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

[mapguide-users] react-layout: Embedding the viewer is not working without resourceId in URL

2017-02-28 Thread Matze
Hi,
I'm testing the react layout (v0.8 - Ajax Viewer). When I use the layout
with the weblayout-resourceId in the URL, it works fine. 
As described in the  Developer Guide

 
, there is a way to set the resourceID within the mount function. 

viewer.mount(el, {
layout: "ajax-viewer",   //The layout to use
agent: {
uri: "../mapagent/mapagent.fcgi" //The mapagent url
},
resourceId: "Library://Path/To/Your.WebLayout"
});

But this isn't working for me.

"An error occurred during startup
No resource parameter found. This viewer requires this parameter to be set
in the query string and must refer to a valid Web Layout or Application
Definition"

Is it still supported?




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/react-layout-Embedding-the-viewer-is-not-working-without-resourceId-in-URL-tp5309876.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] react-layout: Embedding the viewer is not working without resourceId in URL

2017-02-28 Thread Jackie Ng
This is a bug:
https://github.com/jumpinjackie/mapguide-react-layout/issues/138

- Jackie



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/react-layout-Embedding-the-viewer-is-not-working-without-resourceId-in-URL-tp5309876p5309888.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] react-layout: Hooking to events in the AJAX viewer (OnSelectionChanged)

2017-02-28 Thread Matze
If it is possible, yes.

For what I need this:

As soon as the user touches/clicks on the map and occurs a change/creation
of a selection, the user will get a custum property info in the taskpane
with more properties than in the mapguide propertypane.

For this, I just need an event that the selection has changed. If the event
is fired, i will do some Ajax request by using the sessionId and
selectionXML to get the unique primary keys. Then I can do some database
queries and return the result to fillin the taskpane.

This will be also usefull for the other layouts like sidebar.html




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/react-layout-Hooking-to-events-in-the-AJAX-viewer-OnSelectionChanged-tp5309934p5309951.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] 30 seconds delay after creating +/-100 CreateRuntimeMap calls

2017-02-28 Thread BenSav
Jackie
We are using AIMS 2015 at the moment.
I'll post a code snippet of what we are trying to do tomorrow when at the 
office.

Thx!

[cid:image004.png@01CE52E4.A7D3CDA0]

Ben Savelkoul
0494 64 63 73 |  
ben.savelk...@geosolutions.be

GEO Solutions nv, Prins Boudewijnlaan 41, 2650 Edegem
www.geosolutions.be
GIS op maat van uw organisatie |Advies | Analyse | Ontwikkeling | Data



From: Jackie Ng [via OSGeo.org] [mailto:ml-node+s1560n5309767...@n6.nabble.com]
Sent: dinsdag 28 februari 2017 2:33
To: Savelkoul Ben 
Subject: RE: 30 seconds delay after creating +/-100 CreateRuntimeMap calls

What is the rough pseudo-code of the thing you are doing ~100 times? I want to 
try and get a gauge of what server resources could possible be consumed.

Also, what version of AIMS/MapGuide is this and what WebTier configuration are 
you using?

- Jackie

If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/30-seconds-delay-after-creating-100-CreateRuntimeMap-calls-tp5309691p5309767.html
To unsubscribe from 30 seconds delay after creating +/-100 CreateRuntimeMap 
calls, click 
here.
NAML


image001.png (6K) 





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/30-seconds-delay-after-creating-100-CreateRuntimeMap-calls-tp5309691p5309998.html
Sent from the MapGuide Users mailing list archive at Nabble.com.___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] 30 seconds delay after creating +/-100 CreateRuntimeMap calls

2017-02-28 Thread BenSav
Benoit,
Thanks for your comment. In fact we are creating the runtime maps server side 
sending an array of map definitions in the request as you suggest. Now to 
reduce the load a little bit, I am only doing this for the maps that are to be 
visible at startup of the application. When the user switches additional layers 
on I add them to the session over http but in this case it's only for a few 
layers at a time at most, so we are not experiencing any problems there.

I am wondering, in this blogpost:
http://themapguyde.blogspot.be/2013/08/mapguide-26-feature-showcase.html
It is mentioned that: "There are still unexplored caching opportunities on the 
server side that could make these response times even faster!" could this be 
related to the unexplored caching opportunities?

Cheers

[cid:image004.png@01CE52E4.A7D3CDA0]

Ben Savelkoul
0494 64 63 73 |  
ben.savelk...@geosolutions.be

GEO Solutions nv, Prins Boudewijnlaan 41, 2650 Edegem
www.geosolutions.be
GIS op maat van uw organisatie |Advies | Analyse | Ontwikkeling | Data



From: Benoit Begin [via OSGeo.org] 
[mailto:ml-node+s1560n5309989...@n6.nabble.com]
Sent: dinsdag 28 februari 2017 21:07
To: Savelkoul Ben 
Subject: RE: 30 seconds delay after creating +/-100 CreateRuntimeMap calls

One thing to keep in mind is if you are batching all those calls to the 
mapagent, you might be hitting the cap for simultaneously opened http requests 
to the same server. It's a little bit different from browser to browser, but 
typically only 4 to 8 http requests can be opened simultaneously to the same 
server. So since creating a runtime map can be a little bit time consuming, 
specially when creating so many at once, you might simply be stacking too many 
queries.

You could work around the issue by creating all your runtime maps server-side 
using php/.net and then just returning an array of all the map names you have 
created. This could check if the issue is creating so many maps or if it's 
because of too many http queries at once.

If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/30-seconds-delay-after-creating-100-CreateRuntimeMap-calls-tp5309691p5309989.html
To unsubscribe from 30 seconds delay after creating +/-100 CreateRuntimeMap 
calls, click 
here.
NAML


image001.png (6K) 





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/30-seconds-delay-after-creating-100-CreateRuntimeMap-calls-tp5309691p5309997.html
Sent from the MapGuide Users mailing list archive at Nabble.com.___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] 30 seconds delay after creating +/-100 CreateRuntimeMap calls

2017-02-28 Thread Jackie Ng
If you ran CREATERUNTIMEMAP many times on the same map definition and same
set of parameters, the only difference in the responses you get back are the
session ids. Thus the caching opportunity is to save the rest of the XML
response as a cached "template" and for subsequent requests of the same map
and parameters, just fetch the stored template, plug in the new session id,
make the new MgMap/MgSelection in that session's repository and return that
plugged in XML response.

Still, I don't think this is the actual problem at hand. It might be a bit
slow on some big map definitions, but not "30 seconds" slow.

- Jackie



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/30-seconds-delay-after-creating-100-CreateRuntimeMap-calls-tp5309691p5310028.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: [mapguide-users] 30 seconds delay after creating +/-100 CreateRuntimeMap calls

2017-02-28 Thread BenSav

This is the function we are using to create the runtime map, it is called
from a for-loop:

private void CreateMap(string name, MgMappingService srv)
{
if (!string.IsNullOrEmpty(name))
{
try
{
_log.Info("Trying to create map: " + name);
MgResourceIdentifier resourceID = new
MgResourceIdentifier("Library://" + name + "." +
MgResourceType.MapDefinition);

_log.Info("MapDefinition resource: " +
resourceID.ToString());

srv.CreateRuntimeMap(resourceID, sessionId, 0, 100);

_log.Info("Map created");
}
catch (MgResourceNotFoundException e)
{
_log.Error("Failed to create map: " + name);
_log.Error(e.GetExceptionMessage());
}
catch (Exception e)
{
_log.Error("Failed to create map: " + name);
_log.Error(e.ToString());
}
}
}

This is what is being logged:

09 02 2017 11:22:41 INFO  Starting session
09 02 2017 11:22:41 INFO  Trying to create map:
DWG/Gasdetectie/Maps/OL_Gasdetectie
09 02 2017 11:22:41 INFO  MapDefinition resource:
Library://DWG/Gasdetectie/Maps/OL_Gasdetectie.MapDefinition
09 02 2017 11:22:41 INFO  Map created
09 02 2017 11:22:41 INFO  Trying to create map:
DWG/Kanaal_gent_terneuzen/Maps/OL_Waterwegen_details
09 02 2017 11:22:41 INFO  MapDefinition resource:
Library://DWG/Kanaal_gent_terneuzen/Maps/OL_Waterwegen_details.MapDefinition
09 02 2017 11:22:41 INFO  Map created
09 02 2017 11:22:41 INFO  Trying to create map:
DWG/Kanaal_gent_terneuzen/Maps/OL_Waterwegen
09 02 2017 11:22:41 INFO  MapDefinition resource:
Library://DWG/Kanaal_gent_terneuzen/Maps/OL_Waterwegen.MapDefinition
09 02 2017 11:22:41 INFO  Map created
09 02 2017 11:22:41 INFO  Trying to create map:
DWG/Info.Bloknrs/Maps/OL_Afdelingsnamen
09 02 2017 11:22:41 INFO  MapDefinition resource:
Library://DWG/Info.Bloknrs/Maps/OL_Afdelingsnamen.MapDefinition
09 02 2017 11:22:41 INFO  Map created
09 02 2017 11:22:41 INFO  Trying to create map:
DWG/Info.Bloknrs/Maps/OL_Info_BlokNrs
09 02 2017 11:22:41 INFO  MapDefinition resource:
Library://DWG/Info.Bloknrs/Maps/OL_Info_BlokNrs.MapDefinition
09 02 2017 11:22:41 INFO  Map created
.
.
.
09 02 2017 11:22:42 INFO  Trying to create map:
DWG/Nutsleidingen_gasvorm/Kooksgas/Maps/OL_196_info
09 02 2017 11:22:42 INFO  MapDefinition resource:
Library://DWG/Nutsleidingen_gasvorm/Kooksgas/Maps/OL_196_info.MapDefinition
09 02 2017 11:22:42 INFO  Map created
09 02 2017 11:22:42 INFO  Trying to create map:
DWG/Nutsleidingen_gasvorm/Kooksgas/Maps/OL_196_kooksgas
*09 02 2017 11:22:42 INFO  MapDefinition resource:
Library://DWG/Nutsleidingen_gasvorm/Kooksgas/Maps/OL_196_kooksgas.MapDefinition
09 02 2017 11:23:12 INFO  Trying to create map:
DWG/Nutsleidingen_gasvorm/Hoogovengas/Maps/OL_195_RegNr_hoogovengas*
09 02 2017 11:23:12 INFO  MapDefinition resource:
Library://DWG/Nutsleidingen_gasvorm/Hoogovengas/Maps/OL_195_RegNr_hoogovengas.MapDefinition
09 02 2017 11:23:12 INFO  Map created
09 02 2017 11:23:12 INFO  Trying to create map:
DWG/Nutsleidingen_gasvorm/Hoogovengas/Maps/OL_195_info
09 02 2017 11:23:12 INFO  MapDefinition resource:
Library://DWG/Nutsleidingen_gasvorm/Hoogovengas/Maps/OL_195_info.MapDefinition
09 02 2017 11:23:12 INFO  Map created


So you can see clearly there is a pause or delay of exactly 30 seconds. 






--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/30-seconds-delay-after-creating-100-CreateRuntimeMap-calls-tp5309691p5310061.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users