Template:Fragoria Map
From FragoriaWiki
(Difference between revisions)
Line 128: | Line 128: | ||
function setMarkers(map, locations) { | function setMarkers(map, locations) { | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
var contentString = '<div id="content">'+ | var contentString = '<div id="content">'+ | ||
Line 172: | Line 150: | ||
'</div>'; | '</div>'; | ||
- | var | + | var myinfowindow = new google.maps.InfoWindow({ |
content: contentString | content: contentString | ||
}); | }); | ||
+ | var dungeonimage = { | ||
+ | url: '/wiki/images/f/f7/Greendungeonicon.png', | ||
+ | size: new google.maps.Size(40, 40), | ||
+ | origin: new google.maps.Point(0, 0), | ||
+ | anchor: new google.maps.Point(20, 20) | ||
+ | }; | ||
+ | var shape = { | ||
+ | coords: [0, 0, 0, 40, 40, 40 , 40, 0], | ||
+ | type: 'poly' | ||
+ | }; | ||
+ | for (var i = 0; i < locations.length; i++) { | ||
+ | var dungeon = locations[i]; | ||
+ | var dungeonLatLng = new google.maps.LatLng(dungeon[1], dungeon[2]); | ||
+ | var marker = new google.maps.Marker({ | ||
+ | position: dungeonLatLng, | ||
+ | map: map, | ||
+ | icon: dungeonimage, | ||
+ | shape: shape, | ||
+ | title: dungeon[0], | ||
+ | infowindow: myinfowindow, | ||
+ | zIndex: dungeon[3] | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | |||
google.maps.event.addListener(marker, 'click', function() { | google.maps.event.addListener(marker, 'click', function() { |
Revision as of 23:00, 6 April 2015