Skip to content

Instantly share code, notes, and snippets.

@smellman
Created March 20, 2011 16:42
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 smellman/878437 to your computer and use it in GitHub Desktop.
Save smellman/878437 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function(){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(p){
var lonlat = new OpenLayers.LonLat(p.coords.longitude,p.coords.latitude).transform(proj_4326, map.getProjectionObject());
map.setCenter(lonlat, 10);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment