Created
June 9, 2011 10:07
-
-
Save feedhenry-gists/1016462 to your computer and use it in GitHub Desktop.
Mapping Example Server Side 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
function getPlacemarks() { | |
var lat = 'undefined' !== typeof $params.lat ? $params.lat : 53.4, | |
lon = 'undefined' !== typeof $params.lon ? $params.lon : -7.4; | |
// Add the passed in location to a points array | |
var points = [{lat: lat, lon: lon, title: 'My Placemark!'}]; | |
// Push some more closeby points onto the array | |
points.push({lat: lat + 0.002, lon: lon - 0.002, title: 'Top Left'}); | |
points.push({lat: lat + 0.002, lon: lon, title: 'Top Middle'}); | |
points.push({lat: lat + 0.002, lon: lon + 0.002, title: 'Top Right'}); | |
points.push({lat: lat, lon: lon - 0.002, title: 'Middle Left'}); | |
points.push({lat: lat, lon: lon + 0.002, title: 'Middle Right'}); | |
points.push({lat: lat - 0.002, lon: lon - 0.002, title: 'Bottom Left'}); | |
points.push({lat: lat - 0.002, lon: lon, title: 'Bottom Middle'}); | |
points.push({lat: lat - 0.002, lon: lon + 0.002, title: 'Bottom Right'}); | |
return {points: points}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment