Created
January 25, 2011 06:55
-
-
Save Billiam/794589 to your computer and use it in GitHub Desktop.
Display Interesting Places as map markers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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