BYES Apps - Map Viewer components - Instructions
MapViewer is a vision component which allows to easily integrate an Open Street Map view into your application.
http://www.openstreetmap.org
Requirement: Ignition V 7.6.0 or greater
Features :
- On line internet maps or off line maps hosted by a webserver like ignition gateway
- Map marker position
- Map marker animation
- Map marker selection
- Zoom control
- Lots of properties to interact with ignition !
Simply drop in the designer. Adjust properties. Bind properties
By default :
- Mouse right on a map market to select it
- Mouse left on a map market to select it
- Mouse wheel to control zoom
- Mouse right without release and move to scrol on the map
Data bindings :
Bind the dataset DataMarkers with ignition tag to animate it :
- Unique Id of the markers
- Latitude position
- Longitude position
- Value for state animation
Animation rules can be set with the dataset DataColorAnimation
and the property : ColorAnimationUnkown in case of the value is not present in DataColorAnimation.
For example :
Properties Tip's:
- IdSelected : contain the last Map markers Id selected.
- ListIdSelected : contain the list of selected Map markers Id.
- LastIdClicked : contain the last Map markers Id clicked. Can be set to 0 by script to manage an event.
- LastListIdClicked : contain the list of Map markers Id clicked for the case of multiple markers are in the same area.Can be set to 0 by script to manage an event.
- DisplayPositionCommand : One Shot Command to center Map according to DisplayPositionLatitude/DisplayPositionLongitude/DisplayPositionZoom.
- DisplayToFitMapMarkers : One Shot Command to center Map to fit all maps markers
Map's sources :
- OnlineMode : Internet map source or specific map server
- OfflineTilesPath : path for specific map server
With OnlineMode=true, Ignition Vision Client must have an Internet acces to use Open Street Maps.
With OnlineMode=false,Property OfflineTilesPath is required to access map tiles server.
Tiles are simply images for the Zoom's levels :
- You can put the tiles files in a local directory off the Vision client : Property OfflineTilesPath : file://D:/myPath
- A better solution is to put the tiles in a web server, for example the Ignition Gateway : Property OfflineTilesPath : http://127.0.0.1:8088/main/tiles/
And put the files in : C:\Program Files\Inductive Automation\Ignition\tomcat\webapps\main\tiles\ of the Gateway
For off line purpose,Tiles can be downloaded with : JTileDownloader
http://wiki.openstreetmap.org/wiki/JTileDownloader
In this case, be careful to select a Reasonnable area for the map, and avoid too high zoom level to reduce the quantity of data.