Questions tagged [google-polyline]

Google Polyline class in Google Map v3

A polyline is a list of points, where line segments are drawn between consecutive points.

481 questions
3
votes
3 answers

Draw google polyline with line width set in meters

I noticed that when you draw a polyline in google maps you set it's width in pixels (strokewidth). Is there a way I could set that in metres instead?
dreza
  • 3,605
  • 7
  • 44
  • 55
3
votes
0 answers

Android google maps API 2 got JSONException: Index 0 out of range [0..0)

im working with google maps API to route between some points (asking google apis for those road paths).. in majority process working good but sometime got a JSONException: Index 0 out of range [0..0) while trying getJSONObject(0) on…
Hallaz
  • 109
  • 2
  • 3
  • 16
2
votes
1 answer

Editable polyline connecting every point in Google Maps API V3

I am trying to draw editable polyline that connects all points I click on using Google Maps API V3. For example, after clicking on 4 different points on the map there should be 6 lines connecting all 4 points, while making these lines editable. I…
JavaNoob
  • 47
  • 1
  • 2
  • 7
2
votes
2 answers

Iterating through a JSON file to display multiple polylines

I am trying to render a map with multiple polylines that are pulled from an external JSON resource. Each JSON record has a number of descriptive fields as well as a field containing an array of LatLngs. The code seems to get the JSON data just…
SteveSong
  • 311
  • 3
  • 15
2
votes
1 answer

How to attach a text to React Google Maps Api Polyline

In this code sample, I want to show the distance attribute on top of the PolyLine with an offset of 45% (almost next to the arrow). But I was not successful in achieving that.
2
votes
1 answer

Polylines get connected from start and end | Google Maps | Android

Problem is that when I draw polylines, they get connected from start and end point which is not supoosed to. I simply decode my polypoints (which are encoded strings from direction api) and then add them to polyoptions to draw polylines on map. Here…
Muhammad Hamza
  • 173
  • 1
  • 6
2
votes
2 answers

How to show multiple sets of polylines in Flutter on one Google map

I am trying to show multiple sets of different polylines (each set represents one cycling route with its own start and endpoint). There are ten routes in total I am bringing in from a JSON file. The problem is the map is consolidating all the…
Daniel Mintz
  • 53
  • 1
  • 7
2
votes
1 answer

How to find overlapping percentage of two polyline stored in mongodb?

I am using google maps API to get directions from one place to another. Google maps returns a polyline that looks something like…
Koustav Chanda
  • 2,285
  • 2
  • 8
  • 10
2
votes
0 answers

How to get the shortest distance of a point from a polyline in python?

I need to find the shortest distance of a specific point P, (lat, lng) from a given polyline in python? What I tried is, converting the polyline to a set of points and then from each point calculating the distance to the given point P and then…
Koustav Chanda
  • 2,285
  • 2
  • 8
  • 10
2
votes
1 answer

Removing travelled polyline from GoogleMaps iOS Swift

I am try to remove travelled polyline from google maps but can't find any proper solution on internet. I've drawn polyline by this, let origin = "\(24.96487181552221),\(67.06045475052892)" //add worker lat long here let destination =…
2
votes
0 answers

flutter google map: Draw Route Line between two location

i am trying to write simple code to draw a route line between two location on google map, i used flutter_polyline_points package for that, i wrote simple code as the follows: List results = await…
omar shady
  • 151
  • 3
  • 8
2
votes
1 answer

How to add markers on Google Maps polylines based on rgw distance along a line in android?

I have drawn a line between two points in google maps. Now I want to add markers in that line for a particular distance.` [![mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng latLng) { …
creativecoder
  • 1,470
  • 1
  • 14
  • 23
2
votes
0 answers

GMSPolyline with dot pattern between multiple pins

I'm trying to draw a dotted polyline on GMSMapView. What I've achieved so far is to add a dashed polyline on the map. For which I've written below code: polyLine.strokeWidth = 10 polyLine.strokeColor = UIColor(red: 95/255, green: 89/255, blue:…
Keyur Tailor
  • 424
  • 3
  • 16
2
votes
1 answer

How to use setTag of polyline to save custom data in Google Maps

When I click on polyline I want time (custom object) to be displayed at that particular lat long position. Code to achieve polyline PolylineOptions lineOptions = new PolylineOptions().width(7).color(Color.BLACK).geodesic(true); for (int i = 0; i <…
2
votes
1 answer

Angular / google map not drawing polyline between path points

Im very new to angular, the issue is my I unable to get agm-polyline to draw the path on my map. My data is populating my Array of objects but no action is being performed after that. Thank you in advance for your help.