[mapguide-users] Call legend palette method from scriptFrame

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Wed Jun 18 14:00:40 EDT 2008


I am not quite sure what you want to do.
If you call SetScale on the legend, it will display the legend as if the 
map was in that scale.
That is probably not what you want.

Javascript is case sensitive, you must use GetLegendCtrl(), not 
getLegendCtrl().

I can only recommend that you install FireFox and the FireBug plugin.
With firebug, you can set breakpoints in code, and examine objects (ea. 
list all avalible functions on a given object):
http://getfirebug.com/

(PS: You will need a FireBug beta for FF3: 
http://getfirebug.com/releases/firebug/1.1/firebug-1.1.0b12.xpi)

Regard,. Kenneth Skovhede, GEOGRAF A/S



Tom Chadwin skrev:
> This works:
>
>   
>> mapFrame.ZoomToView(mapFrame.GetCenter().X, mapFrame.GetCenter().Y, scale)
>>     
>
> Brilliant!
>
> Still, in the spirit of understanding things fully, how does one proceed
> using the method you just described? This fails from the scriptFrame:
>
> parent.mapFrame.getLegendCtrl().SetScale(1000);
>
> Thanks for the help.
>
> Tom
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>> Arh... you have to call mapFrame.GetLegendCtrl()
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Tom Chadwin skrev:
>>     
>>> Hi Kenneth
>>>
>>> Thanks for the reply. I know the description and diagram are in the
>>> Developers' Guide, but the Legend Palette is not present in either the
>>> list
>>> of frames or the diagram. Is it part of mapFrame? If so, it must be a
>>> frame
>>> within it, since I believe that mapFrame.SetScale() throws an error.
>>>
>>> Thanks
>>>
>>> Tom
>>>
>>>
>>>
>>> Kenneth Skovhede, GEOGRAF A/S wrote:
>>>   
>>>       
>>>> The viewer frame layout is described in the "MapGuide Developers Guide" 
>>>> on page 19:
>>>> http://mapguide.osgeo.org/2.0/documentation.html
>>>>
>>>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>>>
>>>>
>>>>
>>>> Tom Chadwin skrev:
>>>>     
>>>>         
>>>>> Hello
>>>>>
>>>>> I cannot work out which frame contains the legend palette functions. I
>>>>> want
>>>>> to execute the Viewer API function SetScale from a script in the
>>>>> scriptFrame, but cannot seem to get the path right.
>>>>>
>>>>> Can anyone help?
>>>>>
>>>>> Many thanks
>>>>>
>>>>> Tom
>>>>>   
>>>>>       
>>>>>           
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080618/9969fdac/attachment.html


More information about the mapguide-users mailing list