[mapguide-users] Zoom to selected feature with Fusion MGOS 2.1 Beta
GreenMapSanMiguel
webmaster at SMAmap.com
Fri Jul 10 13:24:05 EDT 2009
I am unable to zoom to selected features that are outside my initial map view
extents. This occurs when using the Search widget and also when using the
code below:
var mapWidget = Fusion.getMapById('Map');
var selXML = '\<\?xml version="1.0" encoding="UTF-8"\?\>';
selXML += '<FeatureSet
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd">';
selXML += '<Layer id="'+uniqueId+'">';
selXML += '<Class id="Default:fdo_point">'+selectionId;
selXML += '</Class></Layer></FeatureSet>';
mapWidget.setSelection(selXML,true);
The selection itself is working. When the selected feature is within the
initial map view extents, the map correctly zooms to the feature. When the
selected feature is outside the initial map view extents, the map always
zooms to the center of the map. This happens even if I manually zoom out
until the feature is visible before doing the select/zoom.
If I change my initial map view extents to include everything, then I can
zoom to any feature. But... I do not want the initial display of the map to
be zoomed out this far.
Is there another way to allow zoom to anyplace on the map? Can I control
the zoom so that it does not always zoom to the minimum?
Thanks very much for your help!
Andy
--
View this message in context: http://n2.nabble.com/Zoom-to-selected-feature-with-Fusion-MGOS-2.1-Beta-tp3237017p3237017.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list