erich.wanker Posted March 3, 2020 Share Posted March 3, 2020 hi .. to calculate the lenght of a line - i should calculate allso with the altitude .. see as example: https://www.mapcoordinates.net/en is the altitude-value in future possible? At this time i become Lat and Lng Values procedure UniMap1MapClick(Sender: TObject; const Lat, Lng: Double; const Zoom, X, Y, Id: Integer); ThanX Erich Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted March 4, 2020 Share Posted March 4, 2020 You can't get altitude onClick event. We are using Leaflet.js. Leaflet is a map display library, not a data API, not an elevation raster query library. For this, you will have to rely on some kind of elevation dataset. Whether to use a service like that or whether you should have your own elevation dataset is up to you. In any case, Leaflet does not provide a favorite elevation query service by default (contrary to what Google Maps does, as it relies on Google's elevation datasets). 1 Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted March 5, 2020 Author Share Posted March 5, 2020 ThanX for the perfect information :-) i just found the Google elevation dataset api thing and try to play with the google JSON - if i send Longitude and Latitude https://developers.google.com/maps/documentation/elevation/intro function Tf_show_myMap.SendAnfrage(linkadresse:string):string; const cUSER_AGENT = 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)'; var httpResponse: string; Stream: TStringStream; URL, telParams:string; HTTP:TidHTTP; begin URL:=linkadresse; Stream := TStringStream.Create; HTTP:=TIdHTTP.Create(nil); HTTP.ReadTimeout := 10000;{ IdTimeoutInfinite; } HTTP.ConnectTimeout := 10000; try HTTP.Request.UserAgent := cUSER_AGENT; try HTTP.Get(URL, Stream); result:= Stream.DataString; except result:= 'Communication Error!'; end; finally Stream.Free; HTTP.Free; end; end; procedure Tf_show_myMap.UniButton20Click(Sender: TObject); begin showmessage(SendAnfrage('http://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034 [and your API key] ')); end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.