Jam*_*ami 5 javascript google-maps google-maps-api-3
We'd like to open a list of locations in a Google Map link. I've explored many possibilities, but I can't find how to do this.
The map I built using the JavaScript API doesn't show a link to Google Maps with markers on it. I hoped for a "View Larger Map" link like in the Embed API, but none of the variables seemed to add that. I tried the Embed API, but it doesn't take multiple markers.
We need to generate the list dynamically, so MyMaps doesn't work.
The Static Maps API isn't really a Google Map, in that you can't do anything with it.
I tried sending a KML file like this:
http://maps.google.com/maps?q=http://example.com/j.kml
Run Code Online (Sandbox Code Playgroud)
but it looks like Google has discontinued that.
The most promising thing has been the Directions API, but we don't want directions, just a bunch of markers. The URL structure that is showing multiple points is:
https://www.google.com/maps/dir/Mi+Mero+Mole,+5026+Southeast+Division+Street,+Portland,+OR+97206/3+Doors+Down+Cafe,+Southeast+37th+Avenue,+Portland,+OR/Bunk+Downtown,+211+Southwest+6th+Avenue,+Portland,+OR+97204/@45.5135928,-122.661738,14z/
Run Code Online (Sandbox Code Playgroud)
But I tried removing /dir/ to get rid of the directions and Google didn't like that. Has anyone had any luck with this?
我对同一问题的研究表明,您发布的指导 URL 是目前最相关的解决方案。
我唯一可能建议的增强功能是将起始点留空,以便系统会提示用户输入地址作为起始点,或者通过将文字附加Current+Location到旁边的 url 来自动启用地理定位/dir/:
Run Code Online (Sandbox Code Playgroud)https://www.google.com/maps/dir/Current+Location/Mi+Mero+Mole,+5026+Southeast+Division+Street,+Portland,+OR+97206/3+Doors+Down+Cafe,+Southeast+37th+Avenue,+Portland,+OR/Bunk+Downtown,+211+Southwest+6th+Avenue,+Portland,+OR+97204/@45.5135928,-122.661738,14z/
Run Code Online (Sandbox Code Playgroud)https://www.google.com/maps/dir//Mi+Mero+Mole,+5026+Southeast+Division+Street,+Portland,+OR+97206/3+Doors+Down+Cafe,+Southeast+37th+Avenue,+Portland,+OR/Bunk+Downtown,+211+Southwest+6th+Avenue,+Portland,+OR+97204/@45.5135928,-122.661738,14z/
| 归档时间: |
|
| 查看次数: |
2366 次 |
| 最近记录: |