Skip to content

Instantly share code, notes, and snippets.

@jpfuentes2
Forked from zor/gist:4496523
Last active December 10, 2015 21:38
Show Gist options
  • Save jpfuentes2/4496664 to your computer and use it in GitHub Desktop.
Save jpfuentes2/4496664 to your computer and use it in GitHub Desktop.
drawLandmarks: function() {
var parent = this;
var createListenter = function(shapeMarker, landmark) {
google.maps.event.addListener(shapeMarker, 'click', function() {
parent.setLocation('activity', landmark.id, landmark.name, shapeMarker);
});
}
for (var i = 0, landmark; landmark = this.landmarkData[i]; i++) {
if(landmark.type == "circle") {
var shape = this.drawCircle(landmark);
} else {
var shape = this.drawPolygon(landmark);
var shapeMarker = new google.maps.Marker({
position: this.getPolygonCenter(landmark),
title: landmark.name,
map: this.map
});
createListenter(shapeMarker, landmark);
}
this.landmarks.push(shape);
}
this.setBounds();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment