最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Google Maps draw mode measure distance - Stack Overflow

programmeradmin0浏览0评论

I'm trying to implement "Measure Distance" in google maps v3, something like what we can do in Google Maps Web.

I wonder if there is a library that implmente this as a drawingMode of DrawingManager.

I'm trying to implement "Measure Distance" in google maps v3, something like what we can do in Google Maps Web.

I wonder if there is a library that implmente this as a drawingMode of DrawingManager.

Share Improve this question asked May 29, 2015 at 15:07 José RamírezJosé Ramírez 3891 gold badge4 silver badges15 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 13

You can now use this MeasureTool library for Google Maps JavaScript API v3 to do similar to what Google Maps offers.

Measurement tool for Google Maps API - project page

Here is a live demo.

Here's an example I found of a simple ruler that measures distance between two markers:

http://www.barattalo.it/measure-distance-google-maps

The source code is available via a link on that page.

I hope to use the same basic idea in my own Topographic Maps to drag out a series of markers, then use the resulting PolyLine to draw an elevation profile, etc. I'll post a reference to my code here if I'm successful.

That said, since this "Measure distance" UI has been part of the standard desktop Google Maps since July 2014, I would hope that the Google team might share it via the published Google Maps API soon, simplifying our work (not to mention standardizing the UI for such user drawn paths).

FYI,

Chris

发布评论

评论列表(0)

  1. 暂无评论