Map View
Here is a tutorial on adding maps to your exhibit.
To add maps to your exhibit, you must include the map extension (after you include exhibit-api.js):
<script src="http://static.simile.mit.edu/exhibit/extensions-2.0/map/map-extension.js?gmapkey="></script>
If you are using your exhibit locally, you don't need to specify a Google Maps key. To publish your exhibit on the Web, Google Maps requires a key. See the tutorial above for how to get a key.
To include a map view, add to your HTML
<div ex:role="view" ex:viewClass="Map" ex:latlng=".latlng"> </div>
Replace .latlng with the appropriate expression for your exhibit.
Other settings supported include:
| setting name | type of value | default | choices | meaning |
|---|---|---|---|---|
| ex:center | float | 20,0 | latitude/longitude where the map centers at the beginning | |
| ex:zoom | float | 2 | zoom level | |
| ex:size | text | small | size of map controls | |
| ex:scaleControl | boolean | true | whether to show the map scale control | |
| ex:overviewControl | boolean | false | whether to show the map overview control | |
| ex:type | enum | normal | "normal", "satellite", "hybrid" | the type of map |
| 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: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 | text | 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: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 |

