Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. geocoder = new google.maps.Geocoder();
  2.  
  3. function doGeocode(address, callback) {
  4. geocoder.geocode( {'address': ""+address}, function(results, status) {
  5. if(status == window.google.maps.GeocoderStatus.OK) {
  6. var location = results[0].geometry.location;
  7. var lat = location.lat();
  8. var lon = location.lng();
  9. callback(200, lat, lon);
  10. }else{
  11. callback(500);
  12. }
  13. });//function geocode
  14. }
  15.  
  16. // Get the current view.
  17. var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
  18.  
  19. // Set new latitude and longitude values.
  20. lookAt.setLatitude(lat);
  21. lookAt.setLongitude(lng);
  22.  
  23. // Update the view in Google Earth.
  24. ge.getView().setAbstractView(lookAt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement