[mapguide-users] fusion - default tool selected?

Andrew DeMerchant andrew.demerchant at gemtec.ca
Thu Aug 7 10:27:49 EDT 2008


hmm.....so that would involve editing the Select widget and the 
ApplicationDefinition.xml - but in my case, since I'm using Studio / 
Maestro, there IS no ApplicationDefinition.xml file to edit, is there? . 
Surely there's got to be some way to do it just from that init function. 
Is there some link that you know of to get the API?

Andrew


Mike Adair wrote:
> Andrew,
>
> Testing that code snippet doesn't work for me because the 
> activateWidget() method is only defined on the MapWidget.
>
> A more generic solution for this would be to add an 
> <Activated>true</Activated> element for widgets in the 
> ApplicationDefinition file.  Currently there is a <Disabled> property 
> for widgets to disable widgets on startup, this would be something 
> similar.
>
> Mike
>
> Andrew DeMerchant wrote:
>> Would there be a way to do this more generically (ie without having 
>> to hard-code the main name)? Like, why does this work:
>>
>>     var mapWidget = Fusion.getWidgetById('Pan');
>>     mapWidget.activateWidget(Fusion.getWidgetsByType('Pan')[0]);
>>
>> The link to the fusion api on the trac site doesn't exist - so I 
>> don't really see a place to check this stuff....
>>
>> Andrew
>>
>>
>> Mike Adair wrote:
>>> In your Fusion init method (i.e. a function registered to the 
>>> FUSION_INITIALIZED event), you can activate a widget like so:
>>>
>>>    var mapWidget = Fusion.getMapById('mainMap');
>>>    //enable pan widget
>>>    mapWidget.activateWidget(Fusion.getWidgetsByType('Pan')[0]);
>>>
>>> getWidgetsByType returns an array of widgets so the [0] in the above 
>>> statement just selects the first instance of the Pan widget.
>>>
>>> Mike
>>>
>>>
>>> Andrew DeMerchant wrote:
>>>> Is there a way to make the Select tool selected by default in 
>>>> fusion? What I mean is, if I load a Fusion map there is no tool 
>>>> selected. So the user can click and click all they want, but 
>>>> nothing will ever happen until they pick the Select tool (or some 
>>>> other tool). In AJAX and DWF, the Select tool is selected by 
>>>> default - so as soon as the map loads, you can start clicking on 
>>>> the map to see stuff....Is there an easy way to do that in Fusion? 
>>>> Is it a matter of editing the templates somehow?
>>>>
>>>> Andrew
>>>>
>>>> -- 
>>>>     *Andrew DeMerchant*
>>>> *Computer Technologist*
>>>> ph.1-877-2GEMTEC x.163
>>>> fax 506-453-9470
>>>>
>>>> /GEMTEC Limited <http://www.gemtec.ca>
>>>> /191 Doak Road
>>>> Fredericton, NB, Canada
>>>> E3C 2E6
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>
>> -- 
>>     *Andrew DeMerchant*
>> *Computer Technologist*
>> ph.1-877-2GEMTEC x.163
>> fax 506-453-9470
>>
>> /GEMTEC Limited <http://www.gemtec.ca>
>> /191 Doak Road
>> Fredericton, NB, Canada
>> E3C 2E6
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
>
>

-- 
	*Andrew DeMerchant*
*Computer Technologist*
ph.1-877-2GEMTEC x.163
fax 506-453-9470

/GEMTEC Limited <http://www.gemtec.ca>
/191 Doak Road
Fredericton, NB, Canada
E3C 2E6

-------------- next part --------------
Skipped content of type multipart/related


More information about the mapguide-users mailing list