Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create URL to here.com maps Driving Directions with addresses/coordinates passed along

Tags:

here-api

Anybody know how to create a proper URL to link to here.com maps, from my site? We use an extensive amount of API calls to embed the maps inside our site, but I want to send emails to people with a 'Click Here for directions' link inside pointing to here.com driving directions with the address or coordinates built into the URL.

Example:

With Google Maps, all we would have to do is make a simple link like this:

https://www.google.com/maps?saddr=32.5589671,-97.2586011&daddr=32.7787855,-97.4495476

Just pass along the variables saddr and daddr within the URL. I've tried everything to build a proper URL for here.com maps and it doesn't process it properly.

My best attempt was:

https://www.here.com/directions/drive/32.2589671,-97.4486011/Weatherford,_Texas?x=ep&map=30.38114,-89.89326,6,normal

But it does not process this URL properly and now I'm pretty much stuck, since I have tried everything that I know to try.

like image 913
BrianJTX Avatar asked Jan 04 '15 04:01

BrianJTX


People also ask

How do I create a current location link?

Share a map or locationOn your computer, open Google Maps. Go to the directions, map, or Street View image you want to share. Select Share or embed map. If you don't see this option, click Link to this map.

What is the URL of Google Maps?

Launching Google Maps and performing a specific action The only valid value is 1. If api=1 is NOT present in the URL, all parameters are ignored and the default Google Maps app will launch, either in a browser or the Google Maps mobile app, depending on the platform in use (for example, https://www.google.com/maps).


1 Answers

Something like https://www.here.com/directions/drive/start:lat1,lng1/end:lat2,lng2 seems to work.

  • The text before the colon provides the text of the start/end location
  • There should be absolutely no spaces between the latitude and longitude
  • If no map parameter is added, the map view defaults to show the whole route on a street map
  • If a map parameter of the form ?map=lat,lng,zoom,maptype is added, the map initially shows the map view specified, then moves to show the whole route - like this satellite map link

I've checked that the first link (without the map parameter) also works on a Windows Phone to forward to the HERE Maps app if it is installed. I've not tested what happens if the Android or iOS HERE Maps apps are installed on mobile. If the HERE Maps app is not present on a mobile, the site should forward to the m.here.com mobile friendly site.

Other endpoints will vary by device - the following are fine on tablets:

  • Parisian Restaurants https://www.here.com/discover/restaurant?map=48.85,2.35,15,normal
  • New York Traffic https://www.here.com/traffic/explore?map=40.7127,-74,15,normal
like image 109
Jason Fox Avatar answered Oct 02 '22 02:10

Jason Fox