Exhibit/OpenLayers Map View

From SIMILE Widgets
Jump to: navigation, search

This extension is under active development in the SIMILE widgets trunk. It may change while you use it. It is not yet available in the main service branch.

To use the OpenLayers maps in your Exhibit, you must include the map extension with the corresponding service type (after you include exhibit-api.js):

 <script src="http://trunk.simile-widgets.org/exhibit/api/extensions/map/map-extension.js?service=openlayers"></script>

To include a map view, add to your HTML

 <div ex:role="view" 
   ex:viewClass="OLMap" 
   ex:latlng=".latlng">
 </div>

Replace .latlng with the appropriate expression for your Exhibit. The map defaults to the OpenStreetMap provider. Commercial services can be used as the initially viewed layer when the API and service key are included separately. They will be automatically included as layer options when the service API is determined to exist.

Other settings supported include:

setting name type of value default choices meaning
ex:type enum "osm" "osm", "wms", "gmap", "gsat", "ghyb", "gter", "vmap", "vsat", "vhyb", "ymap", "ysat", "yhyb" initial layer displayed. Map types available: OpenStreetMap, Metacarta WMS, Google Street Map, Google Satellite Map, Google Hybrid Map, Google Physical Map, Virtual Earth Street Map, Virtual Earth Satellite Map, Virtual Earth Hybrid Map, Yahoo Street Map, Yahoo Satellite Map, Yahoo Hybrid Map. The corresponding API must be included separately for the commercial services to be made available.
ex:center float null latitude/longitude where the map centers at the beginning; map will initially auto-center to data if no center point is provided
ex:zoom float null zoom level; map will initially auto-zoom to data if no zoom is provided
ex:scaleControl boolean true whether to show the map scale control
ex:overviewControl boolean false whether to show the map overview control
ex:bubbleTip enum "top" "top", "bottom" whether the map bubble points at the top or at the bottom of map markers
ex:mapHeight int 400 the map's height in pixels
ex:mapConstructor function a custom map constructor
ex:projection function a custom projection
ex:color text #FF9000 default color for map marker
ex:colorKey expression expression for getting the keys used to color-code the map markers
ex:colorCoder text id of a color coder
ex:sizeKey expression expression for getting the keys used to size-code the map markers
ex:sizeCoder text id of a size coder
ex:iconKey expression expression for getting the keys used to add icons the map markers
ex:iconCoder text id of an icon coder
ex:selectCoordinator text id of a coordinator
ex:iconSize int 0
ex:iconFit enum "smaller" "smaller", "larger", "none", "both" how to fit icon images into map markers
ex:iconScale float 1 scaling adjustment to icon images after fitting them
ex:iconOffsetX float 0 translational adjustment to icon images (in pixels)
ex:iconOffsetY float 0 translational adjustment to icon images (in pixels)
ex:shape text circle shape of map markers
ex:shapeWidth int 24 width of shape of map markers (in pixels)
ex:shapeHeight int 24 width of shape of map markers (in pixels)
ex:shapeAlpha float 0.7 alpha of shape of map markers
ex:pin boolean true whether map markers have pins
ex:pinHeight int 6 width of pins of map markers (in pixels)
ex:pinWidth int 6 width of pins of map markers (in pixels)
ex:borderOpacity float 0.5 when drawing polygons or polylines, the default opacity of the border or line
ex:borderWidth int 1 when drawing polygons or polylines, the default width of the border or line
ex:borderColor text when drawing polygons or polylines, the default color of the border
ex:opacity float 0.7 when drawing polygons, the default opacity of the polygon fill
ex:sizeLegendLabel text
ex:colorLegendLabel text
ex:iconLegendLabel text
ex:markerScale text
ex:showHeader boolean true whether or not to show the header of the view
ex:showSummary boolean true whether or not to show the summary information of the view
ex:showFooter boolean true whether or not to show the footer of the view
ex:showToolbox boolean true whether or not to show the toolbox
ex:proxy expression expression for getting an item containing a latitude an longitude (specified by ex:lat and ex:long expressions). Needed in the complex case where an item needs to be plotted in multiple locations and you need to be clear which latitude goes with which longitude.
ex:latlngOrder enum "latlng" "latlng","lnglat" whether the data is provided in the form of (latitude, longitude) or the reverse
ex:latlngPairSeparator text ";" character used to separate location pairs in a line or polygon
ex:osmURL text http://tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png OpenStreetMap service URL, change if you're using a cache
ex:wmsURL text http://labs.metacarta.com/wms/vmap0 WMS service URL, change if you're using a cache
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox