GeoDrawer Base Demo

Home | See the custom controllers example | See the advanced example

This example shows the simplest usage of geodrawer library without custom fields. A set of initial data is imported in the map.

No bootstrap, no jQuery. The only library you need to load by your own is the google maps v3.

Exported data:

Click the export icon!

js code:

var cb = function () {
  var mymap = new geodrawer.Map('#map-canvas', {
    tools: {
      point: {
        options: {
          maxItemsAllowed: 5,
        }
      },
      polyline: {
        options: {
          maxItemsAllowed: 2,
        }
      },
      polygon: {},
      circle: {}
    },
    exportMapCb: function (data) {
      console.log(arguments);
      jQuery('#exported-data').html(JSON.stringify(data))
    }
  });
  mymap.render();
  mymap.importMap({
    point: [{lat: 45, lng: 7}],
    polyline: [
      [{lat: 44, lng: 7}, {lat: 44.3, lng: 7.2}]
    ]
  });
}
geodrawer.ready(cb);