polyline

Getting the bounds of a polyline in Google Maps API v3

房东的猫 提交于 2020-01-02 03:31:08
问题 Is there any easy ways to find the bounding box of a polyline using Google Maps API v3? I'm working on a project where I need to update the bounds as data is added and removed from the map. This is pretty easy by just doing bd.extend(point) where bd is the bound object and point is a LatLng object. The problem is when I start removing data I would like it to change the bounds and zoom back in. Are there any built in functions that can do this or will I need to write something for myself? 回答1:

Avoiding vertex drag maps api v3

感情迁移 提交于 2020-01-01 19:13:51
问题 Very simple. I want to avoid the dragging of the first and last vertices. I've tried using dragstart event, but apparently polyline doesn't listen to that one. I've managed to do something with set_at. I have the last position stored, when set_at is called, I check the index of that vertex, and then set the latLng for that vertex to the old one. This was only possible using setAt function which fires the event again. So a created a ignoreNextEvent flag, so It won't go for an infinite loop.

How to convert to Google encoded polyline algorithm format?

让人想犯罪 __ 提交于 2020-01-01 15:52:38
问题 The encoded polyline format for Google maps stores lat/lon information as well as zoom levels. I have a huge text file with lat/lon pairs that i want to convert to this format and for different sections of polylines (i.e. i need to perform a batch conversion) Does anyone know of a code that performs this operation ? 回答1: The definitive reference to encoding and decoding polylines is by Professor Mark McClure, at http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ It contains

How to convert to Google encoded polyline algorithm format?

柔情痞子 提交于 2020-01-01 15:52:07
问题 The encoded polyline format for Google maps stores lat/lon information as well as zoom levels. I have a huge text file with lat/lon pairs that i want to convert to this format and for different sections of polylines (i.e. i need to perform a batch conversion) Does anyone know of a code that performs this operation ? 回答1: The definitive reference to encoding and decoding polylines is by Professor Mark McClure, at http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ It contains

How can I get length of SVG polyline element?

做~自己de王妃 提交于 2019-12-30 11:49:07
问题 This is my polyline and I want to get its length. <div class="svg-1"> <svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612.417px" height="274.412px" viewBox="0 0 612.417 274.412" enable-background="new 0 0 612.417 274.412" xml:space="preserve"> <g> <defs> <rect id="SVGID_1_" y="0" width="612.417" height="274.412" /> </defs> <clipPath id="SVGID_2_"> <use xlink:href="#SVGID_1_" overflow="visible" /> </clipPath>

How to draw an arrow on every polyline segment on Google Maps V3

爱⌒轻易说出口 提交于 2019-12-30 02:10:06
问题 I was looking for a solution to this problem on stackoverflow but since I couldn't find the accurate solution I ended up solving it myself and post it here, hope it help. Google Maps provides you the Polyline feature, which based on a list of coordinates can draw a series of lines joining all of them. You can draw a polyline with a single arrow with the following code: var allCoordinates = [ new google.maps.LatLng(26.291, 148.027), new google.maps.LatLng(26.291, 150.027), new google.maps

OTP encoded polyline same as Google encoded polyline?

Deadly 提交于 2019-12-25 14:06:30
问题 I have been researching and trying to make sense. My question: are the encoded polylines that Google gives in its directions api same as the leg geometry encoded polylines of Open Trip Planner? 回答1: Late answer, but yes, Open Trip Planner returns google Encoded Polyline format. You can check this link for reference https://groups.google.com/forum/#!topic/opentripplanner-dev/kuR6fM3fY7I 来源: https://stackoverflow.com/questions/27045701/otp-encoded-polyline-same-as-google-encoded-polyline

Trying To Draw polyline Resulting in Error C# Web App

独自空忆成欢 提交于 2019-12-25 02:22:49
问题 I am trying to draw polyline but there is some error in in overloading method which i can not get why it is resulting in error when i am doing it correctly... my code, private void BuildScript(DataTable tbl) { String Locations = ""; String locations = ""; foreach (DataRow r in tbl.Rows) { // bypass empty rows if (r["Latitude"].ToString().Trim().Length == 0) continue; string Latitude = r["Latitude"].ToString(); string Longitude = r["Longitude"].ToString(); double latitude = Convert.ToDouble(r[

Draw a polyline in Android google maps as the user move

ぐ巨炮叔叔 提交于 2019-12-24 11:37:54
问题 Hy, I'm a newbie in Android, and I've learned about android google maps. I'd like to tracking user movement and draw polyline path in android google maps in real time, can someone help me with the example? I can get the location chage interval but still don't know how to apply it into polyline and keep the data LatLng into array. 回答1: You need to add this/related g.play services virsion line in your gradle in case you haven't. compile 'com.google.android.gms:play-services-maps:8.4.0' As

Swift 3: How to remove the tracked polyline in Google map

给你一囗甜甜゛ 提交于 2019-12-24 09:33:06
问题 I have draw the polylines, but I don't no that what coding can remove the tracked polyline in the google map. I'm trying some coding in below. this is no working. var polyline = GMSPolyline() polyline.map = nil this is working to remove tracked polyline, but when I'm maked the markers and tap it, marker can not sow the info window. mapView.clear() Thank you 回答1: Solution: create polyline: teaching polyline by GoogleMapsAPIs create variable oldPolylineArr/oldPolyline type GMSPolyline