Page Properties | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Page Properties | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
|
Overview
iShare GIS has a plugin system which allows you to add buttons and dialogues which you can use for custom functionality. This guide describes that system and takes you through the steps for creating a custom plugin.
...
- An understanding of how to write and debug JavaScript
Overview
The plugin system is already used to add the Standard and Advanced toolbars into iShare GIS, but can be customised to add/remove buttons as required. It accomplishes this by reading a specific XML file for a Map Source, or if one isn't specified, the default one. This XML file describes which plugin to add, each of which is a sub-folder of the folder containing the XML file.
...
The default plugins XML file (/web/plugins/iShareGIS.xml) contains the following:
Code Block | ||||
---|---|---|---|---|
| ||||
<PluginView> <Plugin>LayerPanel</Plugin> <Plugin>Edit</Plugin> <Plugin>Find</Plugin> <Plugin>Output</Plugin> <Plugin>Layers</Plugin> <Plugin>BaseMap</Plugin> <Plugin>Profiles</Plugin> <Plugin>Select</Plugin> <Plugin>View</Plugin> </PluginView> |
...
The plugins folder has the following subfolders:
...
As you can see, each plugin name references a sub-folder, and in each sub-folder, there are three files, all named the same as the sub-folder, but with different extensions e.g.
...
In order for iShare GIS to load your custom plugins, you will need to manually add a PluginViews section, pointing to both the default iShareGIS.xml and your CustomPlugins.xml file, to any Map Source where you wish the plugins to be available as shown here.
Code Block | ||
---|---|---|
| ||
<MapSource version="200" guid="012345678-9abc-def0-1234-56789abcdef"> <LayerGroups> ... </LayerGroups> <PluginViews> <PluginView>plugins/iShareGIS</PluginView> <PluginView>custom/plugins/CustomPlugins</PluginView> </PluginViews> </MapSource> |
...
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||
---|---|---|
| ||
<Plugin> <Name>drilldown</Name> <Description>Enables Enables interactive selecting of features from pre-defined layers via the map</Description> <Category>advanced</Category> </Plugin> |
...
This produces the following output in a dialog:
CurrentView
This plugin will produce an image of the current view of the map.
...