[mapguide-users] Bypassing initial view at startup

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Aug 28 15:36:50 EDT 2008


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 center/scale info

Option number 1 has a drawback, as you will request two initial images.
Option number 2 is going to give you headaches when you upgrade.

I'm not a PHP expert, but I'm sure someone else has the correct code.
Are there any steps that you want explained from the link you provided?

Regards, Kenneth Skovhede, GEOGRAF A/S



gingerbbm skrev:
> 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.
>
> /mapguide/mapviewerajax/?WEBLAYOUT=Library://Trial/Trial.WebLayout&LOCALE=en
>
> Originally I thought that I would need to interrupt the initial map load to
> dabble with the web layout's XML, but http://tinyurl.com/6jkdyj talks about
> creating a copy of the web layout, making the desired changes, and saving it
> to the session, and using the copy. So would the following be the right way
> to go?
>
> 1. Change the main page's iframe to have no src attribute specified
> 2. On page load, call a PHP script to create a web layout in the session
> based upon the one in the library
> 3. Dynamically set the iframe's src to be something like
> "...?WEBLAYOUT=Session://..."
>
> I hope one of you seasoned MapGuide developers can put me straight on this!
> Thanks for your time.
>
> Stuart
>   


More information about the mapguide-users mailing list