Questions tagged [polyline]

Polyline in computer graphics is a continuous line composed of one or more line segments.

Polyline in computer graphics is a continuous line composed of one or more line segments. You can create a polyline by specifying the endpoints of each segment.

1062 questions
28
votes
2 answers

Google Maps API: Calculate Center/Zoom of Polyline

I have an overlay that is dynamically generated from user data, so I need to know how to find the center of that overlay. Currently, I am just using the first coordinates from the overlay, but that really does not represent the center of the…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
28
votes
8 answers

Decoding polyline with new Google Maps API

I am drawing a route between two points in a map. I receive the points this way: StringBuilder urlString = new StringBuilder(); urlString.append("http://maps.googleapis.com/maps/api/directions/json"); urlString.append("?origin=");// from …
Fustigador
  • 6,339
  • 12
  • 59
  • 115
27
votes
1 answer

Styling a Google Maps v3 Polyline with Dashes or Dots?

I'd like to take a Google Map v3-based map with some custom polylines, and make some of those lines dotted or dashed. I can't seem to find any way of doing this. Is it possible, and if so, how?
David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
24
votes
2 answers

Google Maps API v3 remove all polylines

Little background. I have a navigation setup for when you click on a certain navigation item, it creates markers on the map. If you click on a different navigation item, it removes the previous markers and sets up new ones. Well now I am working…
Romes
  • 3,088
  • 5
  • 37
  • 52
20
votes
2 answers

How does polyline simplification in Adobe Illustrator work?

I'm working on an application that records strokes, which you paint with a pointing device. In the image above, I've drawn a single stroke, which contains 453 data points. My goal would be to drastically reduce the amount of data points while still…
Oliver Salzburg
  • 21,652
  • 20
  • 93
  • 138
19
votes
5 answers

Highlighting borders of state and cities of US in Google Map API 3

I have a scenario where I have to highlight borders and shade a state or city after geocoding it (when I got the lang and lat). How can I do this, do I need to have a complete information of a city to surround it with polylines? Or is there a way…
Tahir
  • 3,344
  • 14
  • 51
  • 69
18
votes
2 answers

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

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…
Martín C
  • 1,027
  • 1
  • 9
  • 13
17
votes
5 answers

How to add markers on Google Maps polylines based on distance along the line?

I am trying to create a Google Map where the user can plot the route he walked/ran/bicycled and see how long he ran. The GPolyline class with it’s getLength() method is very helpful in this regard (at least for Google Maps API V2), but I wanted to…
mikl
  • 23,749
  • 20
  • 68
  • 89
16
votes
9 answers

zoom over specific route google map

I have a list of random latitude and longitude points and I am drawing a route between them. My question is how to bound this route within google map I made below utility method public static void drawRouteIntoMap(final List
Hardik Mehta
  • 867
  • 1
  • 12
  • 20
16
votes
1 answer

Animate google maps polyline

I'd like to draw an animated (geodesic) polyline in google maps, a bit like this: http://planefinder.net/route/SFO/ I found many tutorials on how to animate a symbol along a polyline, but nothing about animating the polyline itself from the source…
emathias
  • 211
  • 1
  • 2
  • 7
15
votes
3 answers

Determining approximate overlaps of a given polyline with a set of existing polylines

I have a set of polylines (numbering in the 100s of thousands, with each polyline having about 200-300 vertices). These represent routes on a map (all taken from Google Maps API, if that helps). The vertices are latitude/longitude coordinates. I am…
ARV
  • 6,287
  • 11
  • 31
  • 41
14
votes
1 answer

Google maps: API 3, how to set polyline in the center

Hi all I need to be able to center the polyline in the center of the map Only the necessery part of the code... success: function(data) {//callback to be executed when the response has been received data = JSON.parse(data); for (var…
user123_456
  • 5,635
  • 26
  • 84
  • 140
14
votes
1 answer

WPF bing maps control polylines/polygons not draw on first add to collection

I'm working on this surface project where we have a bing maps control and where we would like to draw polylines on the map, by using databinding. The strange behaviour that's occuring is that when I click the Add button, nothing happens on the map.…
ChristiaanV
  • 5,401
  • 3
  • 32
  • 42
13
votes
2 answers

Detect tap on GMSPolyline in Swift?

I'm struggling with detecting a tap on a GMSPolyline drawn on my Google map, it works just fine with GMSpolygones, but the same approach doesn't seem to work with polyline. My current approach, which works for polygones, is: if…
Recusiwe
  • 1,594
  • 4
  • 31
  • 54
13
votes
4 answers

How to detect a click on a polyline

If there is a polyline on googlemap and a click is performed on the map, then how can I check whether that click was on polyline or somewhere else? Polyline line = googleMap.addPolyline(new PolylineOptions() .add(new LatLng(51.2, 0.1), new…
shehzy
  • 2,215
  • 3
  • 25
  • 45
1
2 3
70 71