polyline

Check user is following the route or not (iphone)

喜夏-厌秋 提交于 2019-12-02 19:52:05
i am making an navigation based application. In this application i am drawing a route from points selected by the user. I have requirement of recalculating route if user is not following the route. for Calculating the route i have used Google direction API . and for drawing the route i have used this code - (void) drawRoute:(NSArray *) path { NSInteger numberOfSteps = path.count; [self.objMapView removeOverlays: self.objMapView.overlays]; CLLocationCoordinate2D coordinates[numberOfSteps]; for (NSInteger index = 0; index < numberOfSteps; index++) { CLLocation *location = [path objectAtIndex

Is it possible to make MGLPolyLines selectable? - Swift, MapBox

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 09:56:33
Is it possible to make an MGLPolyLine touchable/selectable/have user interaction? In my project, the user needs to touch the polyline. There was this question asked before but it is outdated by about 2 years. Have they (MapBox) updated this? I've just checked back and it looks like this has been implemented though I'm not sure which Mapbox release rolled this out. If you take a look at the simple Mapbox example, Annotation Models , that demos an MGLPolyline and interspaced circular annotations, you can make a simple mod to the supplied code and see for yourself. The demo looks like this: If

How can I calculate a current distance to polyline points on google maps v2 in android?

ⅰ亾dé卋堺 提交于 2019-12-02 07:28:44
I have used tutorial from the link below to display Google map route in Android app. My question is how can I calculate distance to polyline points on map? Like when I use Google maps app and it tells when a street turn is getting close. I want to implement similar feature in my app. I am able to display the route polyline on the map and it updates itself while I drive along it but I want it to warn me 500 feet in advance of a coming turn. How can I do that? Here is the link: http://jigarlikes.wordpress.com/2013/04/26/driving-distance-and-travel-time-duration-between-two-locations-in-google

drawing a line in google maps perpendicular to two points

橙三吉。 提交于 2019-12-01 17:13:20
I have two coordinates for which I would like to draw a perpendicular line of equal length. Is there either a simple google maps offset for this or a clean javascript approach by which I might accomplish this? What would that be? Here is what I have thus far. As you can see, I plot the two points as markers and then attempt to draw a line between them, except I need to get that line perpendicular to the line between the two coordinates. var locations = [ ['', position.coords.latitude, position.coords.longitude, 1], ['', llat, llng, 2] ]; var marker, i; for ( var i = 0; i < locations.length; i+

How can I get length of SVG polyline element?

…衆ロ難τιáo~ 提交于 2019-12-01 11:53:33
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> <polyline class="square-1" clip-path="url(#SVGID_2_)" fill="none" stroke="#B2965F" stroke-width="4"

colourful polylines in android maps api v2

久未见 提交于 2019-12-01 08:23:31
I want to draw polyline in android maps api version 2. I want it to have many colors, preferably with gradients. It seems to me though, that polylines are allowed to have only single color. How can I do that? I already have api-v1 overlay drawing what I like, so presumably I can reuse some code public class RouteOverlayGoogle extends Overlay { public void draw(Canvas canvas, MapView mapView, boolean shadow) { //(...) draws line with color representing speed } Guillaume Noël-Martel I know it's been a pretty long time since this has been asked, but there are still no gradient polylines (as of

colourful polylines in android maps api v2

元气小坏坏 提交于 2019-12-01 06:57:34
问题 I want to draw polyline in android maps api version 2. I want it to have many colors, preferably with gradients. It seems to me though, that polylines are allowed to have only single color. How can I do that? I already have api-v1 overlay drawing what I like, so presumably I can reuse some code public class RouteOverlayGoogle extends Overlay { public void draw(Canvas canvas, MapView mapView, boolean shadow) { //(...) draws line with color representing speed } 回答1: I know it's been a pretty

How to draw UIBezierPath identical to MKPolyline in a UIView

给你一囗甜甜゛ 提交于 2019-12-01 05:47:30
问题 Currently I am tracking my location on an MKMapView. My objective is to draw a bezier path identical to an MKPolyline created from tracked locations. What I have attempted is: Store all location coordinates in a CLLocation array. Iterate over that array and store the lat/lng coordinates in a CLLocationCoordinate2D array. Then ensure the polyline is in the view of the screen to then convert all the location coordinates in CGPoints. Current attempt: @IBOutlet weak var bezierPathView: UIView!

drawing a line in google maps perpendicular to two points

会有一股神秘感。 提交于 2019-12-01 02:47:09
问题 I have two coordinates for which I would like to draw a perpendicular line of equal length. Is there either a simple google maps offset for this or a clean javascript approach by which I might accomplish this? What would that be? Here is what I have thus far. As you can see, I plot the two points as markers and then attempt to draw a line between them, except I need to get that line perpendicular to the line between the two coordinates. var locations = [ ['', position.coords.latitude,

How to draw Uber polyline?

ⅰ亾dé卋堺 提交于 2019-12-01 00:44:01
Uber app has a polyline that is curved, and even includes a shadow. The shadow may be just a black with transparent polyline connecting two points. That is easy. But the second polyline with curve, how to accomplish this? Is this a Bezier curve, or a built in function like setGeodesic(true)? I have looked through the google maps examples and I see a section about circle polylines. Can this be adapted to create semi circles? Code snippet from demo. PolylineOptions options = new PolylineOptions(); int radius = 5; //What is that? int numPoints = 100; double phase = 2 * Math.PI / numPoints; for