【问题标题】:Is it possible to make polygons using jquery mobile and google maps v3?是否可以使用 jquery mobile 和 google maps v3 制作多边形?
【发布时间】:2012-09-07 14:24:52
【问题描述】:

有谁知道是否可以使用 jQuery Mobile 平台和 Google maps v3 围绕标记(特别是半径)制作多边形?

我希望它有点像这样工作:

https://developers.google.com/maps/articles/mvcfun

https://google-developers.appspot.com/maps/articles/mvcfun/step3

但为 jQuery mobile 格式化。谢谢!

【问题讨论】:

    标签: jquery-mobile google-maps-api-3 map polygons


    【解决方案1】:

    是的,如果您只想要像素空间中的一个圆圈,请使用Symbol 作为MarkerOptions 中的icon

    如果您想要以实际米为单位,请使用 Circle 叠加层。

    我不确定您所说的“为 jQuery 移动设备格式化”是什么意思 - Google Maps API 在桌面移动设备上运行良好 - 相同的代码应该正常工作 .

    【讨论】:

    • 感谢您的回复,克里斯!我要做的是在标记周围和 userLocation 周围使用这些圆圈(我现在已经实现了),但是当 userLocation 的圆圈与地图上的 markerLocation 的圆圈相交时,我想创建某种通知。对此有什么想法吗?
    • 如果你在谈论地球上的圆圈,那么你需要做的就是计算两点之间的距离。
    • 感谢您的帮助!我最终使用: distance = google.maps.geometry.spherical.computeDistanceBetween(markerPosition, userLocation);计算半径。
    猜你喜欢
    • 2012-01-01
    • 2012-06-08
    • 2011-11-22
    • 2014-05-09
    • 2011-09-25
    • 2011-03-08
    • 1970-01-01
    • 2014-12-31
    • 2016-07-20
    相关资源
    最近更新 更多