Widget that zoom on a specific feature on the map. Zoom on one or many features are supported. Currently this widget uses featureserver as service. The code to use a server-side mapserver service is there, but commented out.
To zoom the map on a feature during the initial page load, add the the parameter specified in the urlfield option in the URL.
Zoom on feature with fid equal url value (index.php?id=3)
<initialview>
<name>InitialView</name>
<options>
<urlfield>id</urlfield>
</options>
</initialview>
<initialview>
<name>InitialView</name>
<options>
<urlfield>id</urlfield>
<defaultzoom>9</defaultzoom>
<!-- Optionnaly turns highlight on -->
<highlight>true</highlight>
</options>
</initialview>
Zoom on all features with dumpingid equal url value (index.php?dump=3)
<initialview>
<name>InitialView</name>
<options>
<urlfield>dump</urlfield>
<queryfield>dumpingid</queryfield>
</options>
</initialview>
Sample config with zoom to max extent replaced by zoom to initial view
<initialview>
<name>InitialView</name>
<options>
<urlfield>dump</urlfield>
<queryfield>dumpingid</queryfield>
<replaceZoomToMaxExtent>true</replaceZoomToMaxExtent>
</options>
</initialview>
| urlfield: | URL variable that will contain the unique ID of the feature |
|---|
| defaultzoom: | Lowest zoomlevel to zoom at intial load. This is an OpenLayers zoom level. |
|---|---|
| highlight: | This node can be set to true or false (both lower case); if true the zoomed to feature will be highlighted according to the default (or user configured) selected style; defaults to false. NOTE : If you want to see highlighted features on the map, you will need to define a featureserver type layer. Otherwise, a red cross showing the feature center will be displayed. In the latter case, a featureserver type service is still needed for the resource zoomed to. |
| queryfield: | Queryable field on features to zoom. |
| haslayer: | boolean, the resourse used have a layer defined or not. |
| replaceZoomToMaxExtent: | |
| If set to true, all “zoom to max extent” behaviors are replaced by “zoom to initial view” instead. | |
featureserver
read