aboutsummaryrefslogtreecommitdiff
path: root/examples/example.js
blob: dc9bf1c777f92fc031c5ec14c40f39092ee66e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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(' ');
}