[mapguide-users] Bypassing initial view at startup
Rock Beans
rockbeans at gmail.com
Thu Aug 28 16:09:56 EDT 2008
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
<ks at geograf.dk> wrote:
> 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
>>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
More information about the mapguide-users
mailing list