diff options
Diffstat (limited to 'examples/example.js')
-rw-r--r-- | examples/example.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/examples/example.js b/examples/example.js new file mode 100644 index 0000000..dc9bf1c --- /dev/null +++ b/examples/example.js @@ -0,0 +1,50 @@ +// Map element +var mapID = 'map'; + +// Service URL +var mapService = 'TODO'; + +// Set map options +var mapOptions = { + center: new google.maps.LatLng(0, 0), + zoom: 5, + scrollwheel: false, + mapTypeId: google.maps.MapTypeId.TERRAIN, +}; + +// Create a map instance +var map = new google.maps.Map(document.getElementById(mapID), mapOptions); + +// Setup a gmapArcgis wrapper +var myGmapArcgis = new gmapArcgis({ + map: map, + + mapName: mapID, + + layers: { + mylayer: { + overlayTime: 5000, + uri: mapService, + opacity: 0.65, + layers: [1], + showOn: [ 'map' ], + }, + + markers: { + mymarker: { + uri: mapService + '/1', + overlayTime: 2000, + fields: [ ], + content: markerCallback, + icon: 'example.png', + showOn: [ 'map' ], + }, + }, +}); + +myGmapArcgis.addLayers('mylayer'); +myGmapArcgis.addMarkers('mymarker'); + +function markerCallback(attributes) { + return attributes.join(' '); +} |