Google Maps Find Altitude

Determine the altitude (elevation) when a point is tapped/clicked on a map

Due to significant price increases we can no longer offer all functionally. You may find some functions are no longer available or have limitations in use

[Map Height : Small - Medium - Large]

Description

Use a map to determining altitude (elevation) when a point is tapped/clicked on a map. You can click/tap ad many times as required to find the elevation of multiple points.

Google Maps Find Altitude

How To Use

  1. Click on the map on a location where you wish to find the altitude
  2. The altitude will be displayed in the message box below the map and when you hover over the marker
  3. You can click to place more than one marker and return to hover over each in order to find out the altitude again
  4. Click the [Clear Map] button in order to remove all markers and start again
  5. Use the search option to find a place
  6. Click on a marker to remove it

You can also access a CSV list of latitude, longitude, altitude in meters and altitude in feet for every marker you place on the map.

Future Updates and Ideas

  • Output in location in UTM Grid coordinates

How it Works



var output_lat =new Array(0);
var output_lng =new Array(0);
var output_f =new Array(0);
var output_m =new Array(0);
var outputDiv=document.getElementById('outputDiv');
var map;
var routeMarkers=new Array(0);
var routePoints=new Array(0);
var geocoder;
var latlngbounds;	
var addresslimit=100;
var bool_toggle_draw_line=false;
var lineWidth=1;
var lineColor='#ff0066';
var routePath;

function initialize() 
{
	var latlng = new google.maps.LatLng(0,0);
	//setCursor:'crosshair'
	var myOptions = {zoom:1,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP,draggableCursor:'crosshair',mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scaleControl:true};
	map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
	
	// Create ElevationService
    elevator = new google.maps.ElevationService();

    // Add a listener for the click event and call getElevation on that location
    google.maps.event.addListener(map, 'click', mapclickedevent);
		  
	geocoder = new google.maps.Geocoder();	
	latlngbounds = new google.maps.LatLngBounds();
}

function foundsingle(first)
{
	var latlng = new google.maps.LatLng (parseFloat(first.lat),parseFloat(first.lng));
	var obj=new Object();
	obj.latLng=latlng;
	getElevation(obj);
}

function mapclickedevent(event)
{
	getElevation(event.latLng); 
}

function getElevation(clickedLocation) 
{
	var locations = [];
		
	locations.push(clickedLocation);
	
	// Create a LocationElevationRequest object using the array's one value
	var positionalRequest = {'locations': locations};
	
	// Initiate the location request
	elevator.getElevationForLocations(positionalRequest, function(results, status) 
	{
		if (status == google.maps.ElevationStatus.OK) 
		{
			// Retrieve the first result
			if (results[0]) 
			{
				// Open an info window indicating the elevation at the clicked position
				outputDiv.innerHTML= "Last point clicked : " + results[0].elevation.toFixed(3) + " m / " + (results[0].elevation*3.2808399).toFixed(3) + " feet";
				
				//add the marker
				var marker=placeMarker(clickedLocation,results[0].elevation.toFixed(3) + " m / " + (results[0].elevation*3.2808399).toFixed(3) + " feet");
				marker.setMap(map);
				addCloseEvent(marker,routeMarkers.length);
				
				routeMarkers.push(marker);
				ftn_drawline();	
				
				latlngbounds.extend(clickedLocation);
				
				output_lat.push(clickedLocation.lat());
				output_lng.push(clickedLocation.lng());
				output_f.push((results[0].elevation*3.2808399).toFixed(3));
				output_m.push(results[0].elevation.toFixed(3));
				
				ftn_makecsv();
			} 
			else 
			{
				outputDiv.innerHTML="No results found";
			}
	  	} 
	  	else 
	  	{
			outputDiv.innerHTML="Elevation service failed due to: " + status;
		}
	});
}

function addCloseEvent(marker,index) {
  	marker.addListener('click', function() {
	marker.setMap(null);
		
	if (routeMarkers.length > 1)
	{
		ftn_drawline();
	}
	else
	{
		//hide the polyline
		if (routePath)
		routePath.setMap(null);
	}
	ftn_makecsv(); 
  });
}

function placeMarker(location,text) 
{
	var image = 'images/gmmarkersv3/stripes.png';
	var marker = new google.maps.Marker({position:location,map:map,icon:image,title:text});
	return marker;
}

function clearmap()
{
	if (routeMarkers) 
	{
		for (i in routeMarkers) 
		{
			routeMarkers[i].setMap(null);
		}
	}
	routeMarkers=new Array(0);

	if (routePath)
	{
		routePath.setMap(null);
	}
	
	outputDiv.innerHTML="";
	
	latlngbounds = new google.maps.LatLngBounds();
	
	output_lat = new Array(0);
	output_lng = new Array(0);
	output_f = new Array(0);
	output_m = new Array(0);
	
	document.getElementById("ta_csvoutput").style.display="none";
	document.getElementById("ta_csvoutput").value="";
	
	document.getElementById("goto").value="";
	document.getElementById("btn_go").value="Search";
}

function ftn_makecsv()
{
	document.getElementById("ta_csvoutput").style.display="block";
	document.getElementById("ta_csvoutput").value="";
	
	output="number";
	if (document.getElementById("cb_output_latlng").checked)
	{
		output+=",latitude,longitude";
	}
	if (document.getElementById("cb_output_meters").checked)
	{
		output+=",meters";
	}
	if (document.getElementById("cb_output_feet").checked)
	{
		output+=",feet";
	}
	if (document.getElementById("cb_output_cumulativedistance").checked)
	{
		output+=",cumulative distance (m)";
	}
	output+="\n";
		
	var cumulativedistance=0;
	
	for (i in routeMarkers) 
	{
		if (routeMarkers[i].getMap())
		{
			
			output+=(i + 1);
			if (document.getElementById("cb_output_latlng").checked)
			{
				output+=","+output_lat[i]+","+output_lng[i];
			}
			if (document.getElementById("cb_output_meters").checked)
			{
				output+=","+output_m[i];
			}
			if (document.getElementById("cb_output_feet").checked)
			{
				output+=","+output_f[i];
			}
			if (document.getElementById("cb_output_cumulativedistance").checked)
			{
				var tmp_cumdist=google.maps.geometry.spherical.computeDistanceBetween(routeMarkers[0].getPosition(), routeMarkers[i].getPosition());
				cumulativedistance=parseInt(cumulativedistance) + parseInt(tmp_cumdist.toFixed(0));
				output+=","+cumulativedistance;
			}
			output+="\n";
		}
	}
	
	document.getElementById("ta_csvoutput").value=output;
}

function submitenter(myfield,e)
{
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13)
	{
		ftn_quickfind(document.getElementById('goto').value);
		document.getElementById("goto").focus();
		document.getElementById("goto").select();
		return false;
	}
	else
	{
	   return true;
	}
}

function ftn_quickfind(address) 
{
	document.getElementById("btn_go").value="Searching...";
	geocoder.geocode( { 'address': address}, function(results, status) 
	{
		if (status == google.maps.GeocoderStatus.OK) 
		{
        	var point = results[0].geometry.location;
			if (document.getElementById("cb_dropmarker").checked)
			{
				getElevation(point);
			}
	
			map.setCenter(point);
			map.fitBounds(results[0].geometry.viewport);
			document.getElementById("btn_go").value="Found";  	
      	} 
		else 
		{
			document.getElementById("btn_go").value="Not Found";
			//console.log(address);
      	}
   	});
}

function ftn_zoomtofit()
{
	map.setCenter(latlngbounds.getCenter());
	map.fitBounds(latlngbounds);	
}

function ftn_processaddressupload(str_addresses)
{
	lines = str_addresses.split('\n');
	if (lines.length>addresslimit)
	{
		lines = lines.slice(0,addresslimit);
	}
	cnt=0;
	nextaddress();	
}

function nextaddress()
{
	if (cnt>=lines.length) 
	{
		document.getElementById("btn_ok").title="Complete!";
		ftn_zoomtofit();
		//$.unblockUI(); 
		return;
	}	
	else
	{
		document.getElementById("btn_ok").title="Processed "+(cnt+1)+"/"+lines.length;
	}
	ftn_geocodeaddress(lines[cnt],getElevation);
	cnt++;
}

function ftn_geocodeaddress(address, callbackFunction) 
{
	geocoder.geocode( { 'address': address}, function(results, status) 
	{
		if (status == google.maps.GeocoderStatus.OK) 
		{
			var point = results[0].geometry.location;
			callbackFunction(point);
			nextaddress();
		}
		else
		{
			alert("Address ("+address+")not found!");
			nextaddress();
		}
	});
}

function ftn_toggle_draw_line()
{
	bool_toggle_draw_line=!bool_toggle_draw_line;
	ftn_drawline();	
}

function ftn_drawline()
{
	if (routePath)
	routePath.setMap(null);
	
	//rebuild routePoints based on markers location
	routePoints=new Array(0);
	if (routeMarkers) 
	{
		for (i in routeMarkers) 
		{
			if (routeMarkers[i].getMap())
			{
				routePoints.push(routeMarkers[i].getPosition());
			}
		}
	}
	
	if ((bool_toggle_draw_line)&&(routePoints.length>1))
	{
		routePath=getRoutePath();
		routePath.setMap(map);
	}
	else
	{
		if (routePath)
		routePath.setMap(null);
	}	
}

function getRoutePath()
{
	var routePath = new google.maps.Polyline({
		path: routePoints,
		strokeColor: lineColor,
		strokeOpacity: 1.0,
		strokeWeight: lineWidth,
		geodesic: true
	});
	return routePath;
}

Relevant Links

Google Maps API

Version History

  • Version 1 (28/09/2008)
  • Version 1.1 (28/12/2008)
    • Added quick find option
  • Version 1.2 (21/03/2009)
    • Enlarged output text at bottom of map
  • Version 1.3 (04/12/2009)
    • Output now also displayed in feet
  • Version 2.0 (10/08/2010)
  • Version 2.1 (11/08/2010)
    • Added new local search facility
    • Brought back output in feet
  • Version 2.2 (17/08/2010)
    • Added output to CSV option to allow export of latitude, longitude, meters and feet
  • Version 2.3 (31/08/2011)
    • Now outputs altitude immediatly from a search
  • Version 2.4 (07/10/2013)
    • Added scale control
  • Version 2.4 (10/11/2013)
    • Removed Google Local Search API (Deprecated)
  • Version 3.0 (23/11/2013) - You are here
    • Added option to Upload and Plot Addresses with their elevation
  • Version 3.1 (26/10/2015)
    • New option to draw a line between the markers
  • Version 3.2 (18/08/2016)
    • Cumulative distance is now output
  • Version 3.3 (16/10/2016)
    • Clicking on an elevation marker now removes it

Comments For This Page

Not sure what happened with the address search function...It is not looking for the addresses that I'm trying to search for.
On 26th July 2018
Can't get this to work. Can someone help me?
On 22nd July 2018
Until now, this tool has been very accurate and helpful, than you! But today July 10, 2018 the altitudes are suddenly way off. Click on ocean, and it shows zero feet, but anything else is off. As one example, my home is at 9 feet, but today this tool shows 26 feet. Everything else is off also. Please Help!
On 10th July 2018
On 28th June 2018 - You can see the altitude/elevation on previous markers if you hover your mouse over them. Unfortunately it doesn't save these between sessions.
By Daft Logic on 8th July 2018
Love the height estimator. Only odd thing I've noticed ( today ) is that for the areas I check, some of the elevations have 'risen' from the altitudes reported previously with deltas of 12m-20m. Basically I check specific locations for new running routes with good gradients around Berkshire. E.g. lowland elevation around Cookham Marsh was originally reported ( sampling various locations adjacent to Winter Hill, on the flood plain ), at ~4.5m. Today, the same area averages 25m elevation ( sampling roughly the same points I did previously ). I get that I could've made mistakes reading one or two locations but not five.

I wish I'd taken screenshots before to show it. I suspect this is a Google question since Daftlogic are reading their data.
By Andrew on 5th July 2018
Thanks, just what I was looking for!
On 2nd July 2018
Is there an optional setting for Find Altitude to memorize the markers on the map where I clicked? So that I could go back and look at the altitudes I so carefully clicked? Rechecking the same altitudes by pointing the arrow at one marker at a time? Like how Distance Calculator memorizes, not only the markers, but the order of the markers. And users of Find Altitude even have the option for a line between the markers, also, in the same order that the user clicked the parts of the map. Find Altitude and Distance Calculator could both be on the same page. And when the lines option is selected, along with that selection, the Distance Calculator. Which saves the markers and which gives user the option to create a web link for the selected geographic locations. But for now, is there a way I could set it to save the digitally geographic positions of the markers? Oh- By the way, when I close the window, shut down and start up my computer and revisit Daft Logic - Find Altitude, the previous markers momentarily reappear, along with the map, before the page goes blank and reappears with no markers on the map.
On 28th June 2018
Hi every one,
Is there is a possibility to add an option which gives us the possibility to choose the projection of our countries?
Best regards
By Jamal on 18th June 2018
Hi Kenneth , not sure without more detail. What web browser are you using? Does it work for you if to test it on another web browser or machine/device.
By Daft Loigic on 6th June 2018
I can't get the map to load , I've used this many times and since 2018 the map won't load. any reason why ?
By Kenneth on 6th June 2018
To all those who have been concerned about the "Elevation service failed due to: OVER_QUERY_LIMIT" message, the reason for this message to popup is the constraints set by the Elevation service API which doesn't allow more than a certain amount of requests based on your plan. For more details, go visit this page: https://developers.google.com/maps/documentation/javascript/elevation


By Sravani Kalangi on 25th May 2018
You have provided one of useful tool for the round earth.
Keep up the good work.
By Pran Punyawansiri on 10th May 2018
This proves the earth is flat. If earth was a sphere, the elevation between Vredendal and Pretoria should be different by 4 000m, yet, there is only 1 500m difference,
2.5km curvature missing. The only reason Pretoria is more is because it is located higher up in the land, due to mountains and hills leading up to the inland. The earth is not a
sphere, do some reasearch, it will blow your mind.
By FlatEarthTruth on 19th April 2018
While in 3D satellite view, how can you determine exactly how high up from the ground you are? Yeah i have an idea from looking out the window (if its clear to the ground) while flying if the pilot says how high we are flying, but i like to know when playing around on the screen especially when you zoom in and way out and pretend you are flying.
By Mike on 5th April 2018
The cumulative distance returned here seems to be too large (10 to 15 times more) than actual distance. Did any other members notice this ? I found the actual distance of 1250 m as a total cumulative distance of 17000 m on this map. Sorry, something is seriously wrong with this.
By Ramamohan on 19th March 2018
Great job, could be better with centimetric precision for the distances
By Stefano on 17th March 2018
Hi Steve, unfortunately we have no figure for accuracy. It can only be considered an estimate.
By Daft Logic on 24th February 2018
We are using this software for grade elevation for coarse engineering design and for environmental permitting (construction in flood plains, and potential penetration by antenna poles of airport glidepath). We would like to know what DraftLogic would suggest is the tool's level of accuracy for grade elevations. Is it /- 1'? 2'? 4'? 10'? More? Equally critical, can you tell whether the software is equally accurate everywhere? That is, is the accuracy about the same regardless of location (populated vs. non-populated areas, or mountainous areas versus flatter ones)? Is it equally accurate for the surface of inland water bodies (it seems to be, but I'd like to hear your view on the limits of the software for these purposes)?

Thx.
By Steve Jurow on 24th February 2018
This is a nice tool. But, what is the accuracy in vertical elevations ? It is important to have an idea of this and to make choices about the use of the data for a given purpose with desired accuracy levels.
By Ramamohan on 17th February 2018
This website helped me with information I needed on elevations and road lengths for my project. Thank you

By Rutendo on 2nd February 2018
Has anyone verified the accuracy of the AMSL provided in this site against the standard tools used to measure AMSL?
On 15th January 2018
This has been added to the Future Updates and Ideas list
By Daft Logic on 12th December 2017
I would like for you to add a feature that output the position in UTM Grid coordinates.
Thanks.


By Jack Nelson on 10th December 2017
This does not work
By Paul on 28th November 2017
40 lady game drive killara NSW 2071
On 3rd November 2017
Chutiya mat banao. Doesn't work. According to this Washington monument is shorter than Washington national Cathedral.
On 22nd October 2017
Since some weeks I have an error message "Elevation service failed due to: OVER_QUERY_LIMIT" and cannot measure altitude :-(
By Michal on 10th September 2017
On 6th September 2017, please reload the page and try again.
By Daft Logic on 7th September 2017
Cannot place markers by clicking on the map.
On 6th September 2017
I tried to use this terrific site again for friends in West Palm Beach, but it isn't working. It says only: "Elevation service failed due to over_query_limit" Can anyone please help?
By Paul Brala on 6th September 2017

30 out of 509 comments shown. See all comments.

Add your own comment below and let others know what you think:

Share This Page

Share this page with others using one of the methods below. Telling others about Daft Logic is good and we appreciate your support!