Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- geocoder = new google.maps.Geocoder();
- function doGeocode(address, callback) {
- geocoder.geocode( {'address': ""+address}, function(results, status) {
- if(status == window.google.maps.GeocoderStatus.OK) {
- var location = results[0].geometry.location;
- var lat = location.lat();
- var lon = location.lng();
- callback(200, lat, lon);
- }else{
- callback(500);
- }
- });//function geocode
- }
- // Get the current view.
- var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
- // Set new latitude and longitude values.
- lookAt.setLatitude(lat);
- lookAt.setLongitude(lng);
- // Update the view in Google Earth.
- ge.getView().setAbstractView(lookAt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement