Created
June 9, 2011 10:06
-
-
Save feedhenry-gists/1016460 to your computer and use it in GitHub Desktop.
Mapping Example Showing Placemarks
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
$fh.act({ | |
act: 'getPlacemarks', | |
req: { | |
lat: lat, | |
lon: lon | |
} | |
}, function (res) { | |
var points = res.points; | |
// Iterate over the points array, adding each to the map | |
for (var pi=0,pl=points.length; pi<pl; pi++) { | |
var point = points[pi]; | |
// Create the marker, then add it to the map | |
var pos = new google.maps.LatLng(point.lat, point.lon); | |
var marker = new google.maps.Marker({ | |
position: pos, | |
map: self.map, | |
title: point.title | |
}); | |
} | |
}, function (code, errorprops, params) { | |
// something went wrong. Show error | |
alert(code); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment