单击按钮以突出显示地图标记 (Gmaps) - 如何

Click button to highlight a Map Marker (Gmaps) - how?

本文关键字:Gmaps 如何 图标 地图 按钮 显示 单击      更新时间:2023-09-26

在此页面上,我需要"获取路线"按钮来突出显示地图上已有的三个点/地图标记之一。 到目前为止,我将以下内容包裹在按钮/img周围。

<a href="https://maps.googleapis.com/maps/api/staticmap?center=" + 37.7029 + "," + -121.9335 + "&zoom=13&size=300x300&sensor=false"><img src="images/get-directions.jpg" alt="get directions"></a><br>

尽管该代码不起作用。知道我在哪里出错了该代码或知道更好的方法吗?

看起来您正在使用静态地图网址,但您有嵌入地图?

https://www.google.com/maps/embed/v1/directions
  ?key=API_KEY
  &origin=
  &destination=