如何使用Google Static Maps API将标记保存在其他标记之上?

时间:2017-05-04 19:11:39

标签: php google-static-maps

我有一张最多可显示25个图钉的地图。前9个标记为1-9,其余为通用点标记。

google static map with customizations, showing 9 on top of 8, but 5 on top of 7, as examples

这些标记按顺序添加:1,2,3 ... 9,10,11。它们是9后点(谷歌静态地图仅支持1位数标记)。

问题:#1的标记被较小的点图标掩盖。他们应该在后面。类似地,标记#9覆盖标记#8。令人困惑的是,#5标记位于#7之上 - 这是正确的。较低的数字应位于顶部,虚线标记应位于背面。

我已尝试撤消网址上标记的顺序,但这没有效果。我没有看到使用Static Maps API的z-index选项。

有没有办法实现这个目标?

这是我正在使用的嵌入代码(api key从末尾删除):

.htaccess

这是一个更清晰的markers数组的var_dump,它只需要通过implode()添加到URL中:

http://maps.google.com.au/maps/api/staticmap?center=44.047708,-123.358691&size=640x320&maptype=roadmap&path=fillcolor:0xbca16533%7Ccolor:0x13131300%7Cenc:icalGzn|oVfAyj@pE_j@vIgh@zMwe@nQqb@|Tq^zW_ZhZ}Th\mOp]sIl^oCn^n@`^tF~\pLj[fRbYpWlVj\fSr`@vOfd@xK`g@tGdi@jClj@?zj@kClj@uGbi@yKbg@wOdd@gSr`@mVj\cYpWk[fR_]pLa^tFo^p@m^qCq]sIi\mOiZ}T{W_Z}Tq^oQob@{Mye@wIgh@qE}i@gAyj@&style=feature%3Aall%7Celement%3Aall%7Cvisibility%3Aon%7Csaturation%3A-100%7Cgamma%3A0.54%7C&style=feature%3Aroad%7Celement%3Alabels.icon%7Cvisibility%3Aoff%7C&style=feature%3Awater%7Celement%3Aall%7Ccolor%3A0x4d4946%7C&style=feature%3Apoi%7Celement%3Alabels.icon%7Cvisibility%3Aoff%7C&style=feature%3Apoi%7Celement%3Alabels.text%7Cvisibility%3Asimplified%7C&style=feature%3Aroad%7Celement%3Ageometry.fill%7Ccolor%3A0xffffff%7C&style=feature%3Aroad.local%7Celement%3Alabels.text%7Cvisibility%3Asimplified%7C&style=feature%3Awater%7Celement%3Alabels.text.fill%7Ccolor%3A0xffffff%7C&style=feature%3Atransit.line%7Celement%3Ageometry%7Cgamma%3A0.48%7C&style=feature%3Atransit.station%7Celement%3Alabels.icon%7Cvisibility%3Aoff%7C&style=feature%3Aroad%7Celement%3Ageometry.stroke%7Cgamma%3A7.18%7C&markers=color:black%7clabel:1%7c44.049727,-123.359269&markers=color:black%7clabel:2%7c44.070205,-123.363716&markers=color:black%7clabel:3%7c44.038696,-123.348037&markers=color:black%7clabel:4%7c44.032207,-123.352058&markers=color:black%7clabel:5%7c44.034713,-123.345176&markers=color:black%7clabel:6%7c44.041244,-123.342079&markers=color:black%7clabel:7%7c44.037186,-123.347408&markers=color:black%7clabel:8%7c44.0685,-123.357345&markers=color:black%7clabel:9%7c44.067466,-123.361381&markers=color:black%7csize:mid%7c44.065919,-123.32467%7c44.061237,-123.316459%7c44.052089,-123.348838%7c44.06039,-123.315452%7c44.046916,-123.356956%7c44.044887,-123.36296%7c44.067543,-123.356369%7c44.046884,-123.355275%7c44.042713,-123.363914%7c44.047252,-123.362197%7c44.06151,-123.317522

就像一个例子,我试图在使用以下内容对数组进行反转之前将其反转:

array(10) {
  [0]=> string(54) "&markers=color:black%7clabel:1%7c44.049727,-123.359269"
  [1]=> string(54) "&markers=color:black%7clabel:2%7c44.070205,-123.363716"
  [2]=> string(54) "&markers=color:black%7clabel:3%7c44.038696,-123.348037"
  [3]=> string(54) "&markers=color:black%7clabel:4%7c44.032207,-123.352058"
  [4]=> string(54) "&markers=color:black%7clabel:5%7c44.034713,-123.345176"
  [5]=> string(54) "&markers=color:black%7clabel:6%7c44.041244,-123.342079"
  [6]=> string(54) "&markers=color:black%7clabel:7%7c44.037186,-123.347408"
  [7]=> string(52) "&markers=color:black%7clabel:8%7c44.0685,-123.357345"
  [8]=> string(54) "&markers=color:black%7clabel:9%7c44.067466,-123.361381"
  [9]=> string(291) "&markers=color:black%7csize:mid%7c44.065919,-123.32467%7c44.061237,-123.316459%7c44.052089,-123.348838%7c44.06039,-123.315452%7c44.046916,-123.356956%7c44.044887,-123.36296%7c44.067543,-123.356369%7c44.046884,-123.355275%7c44.042713,-123.363914%7c44.047252,-123.362197%7c44.06151,-123.317522"
}

1 个答案:

答案 0 :(得分:0)

不可能。有35819311的功能请求(静态地图的标记zIndex)。