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
8
votes
2 answers

Algorithm to find intersections between polylines

Bentley-Ottmann algorithm works for finding intersections of set of straight lines. But I have lot of polylines: Is there a way to find intersections of the set of polylines? I'm figuring out, but in the meanwhile, if someone can give some pointers…
Sam
  • 933
  • 5
  • 14
  • 26
8
votes
3 answers

Google Maps polyline: Click on section of polyline and return ID?

I have a Google Maps V3 polyline. I can detect click events on the entire polyline, but can I do anything more advanced with the click event? What I'd like to do is detect which section of the polyline has been clicked, and show this in an alert. …
phil123
  • 195
  • 3
  • 3
  • 8
8
votes
1 answer

Polyline vs Path: Is there any difference

I am able to draw the same thing, using both Polyline and Path, but when it is rendered, I see the difference. That is why the question -
Jay
  • 744
  • 4
  • 14
  • 30
8
votes
1 answer

How to efficiently draw primitives with iOS Metal?

I am trying to draw (and frequently update) a Polyline with the iOS Metal framework and Swift 4 / iOS 11 / XCode 9. For the final project I want to be able to "draw" a line with my finger, capturing the touch events. I am basically adapting the code…
1awuesterose
  • 495
  • 5
  • 15
8
votes
2 answers

Resample curve into even length segments using C++

What would be the best way of resampling a curve into even length segments using C++? What I have is a set of points that represents a 2d curve. In my example below I have a point struct with x and y components and a vector of points with test…
sabotage3d
  • 435
  • 1
  • 6
  • 15
8
votes
2 answers

Change the region (zoom) for mapView Swift

I have a map and I draw a destination between two pins and I have also always open one call out. My problem is that I want to zoom out a little bit more but I tried to do it with this code and it didn't work. let span = MKCoordinateSpanMake(0.0275,…
mike vorisis
  • 2,786
  • 6
  • 40
  • 74
8
votes
2 answers

What exactly are "levels" in polyline encoding/decoding?

What are "levels" in polyline encoding/decoding, and exactly how do they relate to map zoom levels in Google Maps API v3 or Android Maps API v2? The only description I can find is from the Interactive Polyline Encoder Utility: Polylines in Google…
8
votes
2 answers

Android Maps API v2: Polyline gets drawn under tile overlay

I'm trying to draw a tile overlay and a poly line to a google map. I would like the poly line to be rendered on top of the tile overlay so it can be seen. Currently it's drawn under the tile overlay and disappears , my code is as follows: // Draw…
Gyroscope
  • 3,121
  • 4
  • 26
  • 33
8
votes
4 answers

Draw MKPolyline Fill Color

I am attempting to draw a nice MKPolyline on an MKPolylineView. Everything is going great so far - the polyline draws just as I want it to and when I want it to using the following code: [[self map] addOverlay:routeLine]; And this method to tell…
Sam Spencer
  • 8,492
  • 12
  • 76
  • 133
7
votes
2 answers

How can I access, then animate an existing leaflet map polyline using Javascript?

Can anyone suggest how I can access then animate the red polyline here using javascript: http://gymloop.lukem.co.uk (login: User2/pass2, then select 'Challenges') I want to animate the polyline from the first marker to the end of the red line (think…
codecowboy
  • 9,835
  • 18
  • 79
  • 134
7
votes
1 answer

Flutter - Google maps polyline patterns not working

I am trying to add dashed polylines to the google map but the pattern property doesn't seem to work. Below you can see the method that creates the polyline, the pattern is set to dash with 5px gap, but it still shows as a solid line. Is there…
selected
  • 764
  • 2
  • 10
  • 19
7
votes
2 answers

How to get screen XY from Google maps (V3) LatLng?

I have polyline in my map. I want to know the pixel (screen) xy-coordinates, when user clicks the polyline. Click event only returns the LatLng object, so does anyone have a clue how to get the pixel coordinates from latLng? I would appreciate very…
7
votes
2 answers

GMSMapView Draw Custom Polyline in Swift

I made a map view with GMSMapView and I wanted to draw a polyline according to the touch of a finger. but this feature makes me stuck because I have not been able to find the appropriate reference. in my case example like the result domain app that…
Fadielse
  • 381
  • 2
  • 12
7
votes
2 answers

get length of polyline in google maps v3

Does anyone know how you can get the length of a polyline in google maps v3? At the moment I am using Haversine fomula but if the polyline meets the start then it calculates the shortest length. Does anyone know how I can calculate the polyline…
mark harding
  • 129
  • 2
  • 6
7
votes
2 answers

How to draw polyline on google map with two different colors between two locations

I have two locations and i am in need two draw polyline between these two location, I am done with drawing the polyline between these locations. Issue is, that polyline is of one color but due to requirement i have to draw polyline of two different…
Santosh Yadav
  • 338
  • 2
  • 4
  • 15
1 2
3
70 71