创建指向here.com的URL,将行驶方向与传递的地址/坐标进行映射 [英] Create URL to here.com maps Driving Directions with addresses/coordinates passed along

查看:92
本文介绍了创建指向here.com的URL,将行驶方向与传递的地址/坐标进行映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在我的网站上创建一个合适的URL链接到here.com地图吗?我们使用了大量的API调用将地图嵌入到我们的网站中,但是我想向内部带有'Click Here for directions'链接的人发送电子邮件,该链接指向here.com行驶方向以及URL内置的地址或坐标.

示例:

使用Google Maps,我们要做的就是创建一个像这样的简单链接:

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

只需在URL中传递变量saddrdaddr.我已尽一切努力为here.com映射构建正确的URL,但它未正确处理.

我最大的尝试是:

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

但是它不能正确处理此URL,由于我已经尝试了所有我想尝试的方法,所以现在我很受困扰.

解决方案

类似于 https://www.here.com/directions/drive/start:lat1,lng1/end:​​lat2,lng2 似乎可以正常工作.

  • 冒号前的文本提供开始/结束位置的文本
  • 经度和纬度之间绝对不能有没有空格
  • 如果未添加任何map参数,则默认情况下,地图视图会在街道地图上显示整个路线
  • 如果添加了格式为?map=lat,lng,zoom,maptypemap参数,则地图最初会显示指定的地图视图,然后移动以显示整个路线-就像 Android 或 iOS 此处,地图应用已安装在移动设备上.如果移动设备上没有HERE Maps应用,则该网站应转发到 m.here.com 巴黎餐厅 https://www.here.com/discover/restaurant?map=48.85,2.35,15,normal
  • 纽约客流量 https://www.here.com/traffic/explore?map=40.7127,-74,15,normal

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.

解决方案

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:

这篇关于创建指向here.com的URL,将行驶方向与传递的地址/坐标进行映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆