Skip to content

Instantly share code, notes, and snippets.

@Billiam
Created January 25, 2011 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Billiam/794589 to your computer and use it in GitHub Desktop.
Save Billiam/794589 to your computer and use it in GitHub Desktop.
Display Interesting Places as map markers
//http://forums.bukkit.org/threads/interesting-places-name-areas-in-the-world.1463/
var places = {
list : [],
init : function() {
var This = this;
$.get('places.txt', function(data) {
var lines = data.replace(/^\s+|\s+$/g,'').split("\n");
for(var i=1, l=lines.length; i<l; i++) {
var d = lines[i].split(' ');
var markerPosition = fromWorldToLatLng(d[0], d[1], d[2]);
var title = d.slice(4).join(' ');
var marker = new google.maps.Marker({
position: markerPosition,
map: map,
title: title,
icon: 'http://google-maps-icons.googlecode.com/files/fortress.png',
visible: true,
zIndex: 999
});
This.list.push(marker);
}
}, 'text');
},
deleteMarkers : function() {
for(var i=0, i=this.list.length; i<l; i++) {
this.list[i].setMap(null);
}
this.list = [];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment