Just glad I could help :).
I have put up your code in the comunity code samples (I hope you don't
mind):
http://trac.osgeo.org/mapguide/wiki/CodeSamples/PHP/AddLayerToInitialMap
Regards, Kenneth Skovhede, GEOGRAF A/S
gingerbbm skrev:
Well, hooray, and thanks for all your help. I'd like to b
Well, hooray, and thanks for all your help. I'd like to buy you a beer ;)
Here's a snippet that might be useful for others:
// Build a string pointing to the new layer in the Session
$rlLayerResourceId = "Session:$sessionId//$layerName.LayerDefinition";
// Read the XML of the Library Map Defin
The FeatureSource looks ok.
You need to look at how it is all built up:
1 x WebLayout -> 1 x MapDefintion -> 1+ x LayerDefinition ->
FeatureSource (one pr. layer)
So, your LayerDefinition references the FeatureSource, which is allright.
The MapDefinition references the maps, but does not repl
Kenneth, thankyou for your continued help (and patience)!
The key point I was missing is:
Kenneth Skovhede, GEOGRAF A/S wrote:
>
> 2. Insert the polygon layer into the Xml
>
I guess I can do a GetResourceContent() on my polygon layer and insert its
XML into my Map Definition XML. But the poly
The map->Create() should return the runtime map.
However, when you start the viewer, it also calls map->Create() and
destroys your adjusted runtime map.
So, you must do:
1. Load MapDefinition from Library
2. Insert the polygon layer into the Xml
3. Save the MapDefinition to Session
4. Load WebL
Kenneth Skovhede, GEOGRAF A/S wrote:
>
> You must add your layer to the MapDefinition in step 1.
>
OK. I changed my code to do a $map->Create() based upon the Library Map
Definition, whereupon I create the polygon and layer and add it successfully
to $map.
I save that to an MgResourceIdentifi
You must add your layer to the MapDefinition in step 1.
In step 2, you must point the WebLayout to the temporary MapDefinition.
Remember to make the layer visible in the map, as well as in the initial
scale range.
Regards, Kenneth Skovhede, GEOGRAF A/S
gingerbbm skrev:
Having solved the fir
Having solved the first issue of altering the web layout, I now need a
polygon to appear in the initial view.
I have working code to create a polygon based on a passed-in WKT string but
again am struggling conceptually with how to integrate this into the initial
view code.
At the moment this is
As promised, I've added the code to the wiki:
http://trac.osgeo.org/mapguide/wiki/CodeSamples/PHP/InitialMapView
http://trac.osgeo.org/mapguide/wiki/CodeSamples/PHP/InitialMapView
--
View this message in context:
http://n2.nabble.com/RE%3A-Bypassing-initial-view-at-startup-tp790257p833784.htm
Thanks Kenneth. That line was already in my code, albeit commented out.
Previously I had had success with it in IE, only to try it in Firefox
whereupon I'd get a PHP access violation, which would then require me to
restart IIS.
Now that I think about it, this was probably because I was running th
In line 89 you must also pass on the sessionId:
$redirectTo =
"mapguide/mapviewerajax/?WEBLAYOUT=$sessionWebLayout&SESSION=$sessionId";
Regards, Kenneth Skovhede, GEOGRAF A/S
gingerbbm skrev:
Well, I'm almost there. The only problem is that I'm being prompted to log
in, despite successfully
Well, I'm almost there. The only problem is that I'm being prompted to log
in, despite successfully creating a session for the anonymous user. I'd
appreciate any advice. Here's the code:
http://n2.nabble.com/file/n833593/set_initial_view.php set_initial_view.php
Thanks
Stuart
--
View this mess
First of all, thanks for the speedy responses! Glad to know I was on the
right track. As a bit of bed-time reading last night I revisited the
Developer's Guide and it also confirmed the way to go. RTFM, eh?!
I need the map to go straight to the coords/scale passed in via a URL's
querystring, so t
Using studio while editing the map definition you can set the initial
view for all loads. I don't know if I have all the requirements but
this solution seems to simple to work for your needs.
The Rock
On Thu, Aug 28, 2008 at 2:36 PM, Kenneth Skovhede, GEOGRAF A/S
<[EMAIL PROTECTED]> wrote:
> Yes,
Yes, that is the way to go. Although, you PHP page can redirect to the
ajaxviewer,
so you do not have to fiddle with the iframe src, but just point at the
startup PHP page.
There are two other options:
1. handle "onload" in javascript and zoom there
2. modify the ajaxviewer to read the new cent
This is an old thread but very important for me right now.
I want to set the initial view (coords and scale) of a map and have been
struggling conceptually with how to implement this. I have a page containing
an iframe. The iframe's src attribute is the path to a MapGuide web layout,
e.g.
/mapgu
16 matches
Mail list logo