polyline

How to display a moving track on Android device

风格不统一 提交于 2020-01-12 02:28:47
问题 I want to plot my track using GPS on an Android device. I have no problem displaying a completed route but am finding it difficult to show the track as I'm moving. So far, I've found 2 different ways to do that but neither are particularly satisfactory. METHOD 1 PolylineOptions track = new PolylineOptions(); Polyline poly; while (moving) { Latlng coord = new LatLng(lat,lng); // from LocationListener track.add(coord); if (poly != null) { poly.remove(); } poly = map.addPolyline(track); } ie

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

早过忘川 提交于 2020-01-11 12:03:19
问题 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:/

Does this polyline pass through this polygon?

我只是一个虾纸丫 提交于 2020-01-06 14:34:29
问题 I’m trying to test whether a Google Maps polyline passes through a Google Maps polygon. Sounds simple. But I’ve searched and searched... and found no real answers. Closest I got was this function. It works but, frustratingly, returns the occasional false positive. //nvert = the number of points in the polygon //vertx = an array of all the polygon's latitudes //verty = an array of all the polygon's longitudes //elat = the current point's latitude //elng = the current point's longitude function

google map polyline dashed and double lines

坚强是说给别人听的谎言 提交于 2020-01-06 03:41:15
问题 I have a google map polyline sample here with four coordinates. I drawn the dashed line using symbol property as, var lineSymbol = { path: 'M 0,-1 0,1', strokeOpacity: 1, strokeWeight: 2, scale: 3 }; var lineCoordinates = [ new google.maps.LatLng(22.291, 153.027), new google.maps.LatLng(18.291, 153.027), new google.maps.LatLng(15.291, 153.027), new google.maps.LatLng(11.291, 153.027)]; var line = new google.maps.Polyline({ path: lineCoordinates, strokeOpacity: 0, icons: [{ icon: lineSymbol,

Draw a curve (bezier curve) between two lat long points on google maps android

ⅰ亾dé卋堺 提交于 2020-01-04 08:55:43
问题 I want to draw a curve (Beizer curve) between two lat-long points. Currently i am referring this post (code is in javascript). Code to get curve points using cubic bezier equation private void drawElementsOnMap(LatLng init, LatLng end) { mMap.addMarker(new MarkerOptions().position(init)); mMap.addMarker(new MarkerOptions().position(end)); LatLngBounds.Builder bc = new LatLngBounds.Builder(); bc.include(init); bc.include(end); mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bc.build(), 100

Draw a curve (bezier curve) between two lat long points on google maps android

為{幸葍}努か 提交于 2020-01-04 08:55:25
问题 I want to draw a curve (Beizer curve) between two lat-long points. Currently i am referring this post (code is in javascript). Code to get curve points using cubic bezier equation private void drawElementsOnMap(LatLng init, LatLng end) { mMap.addMarker(new MarkerOptions().position(init)); mMap.addMarker(new MarkerOptions().position(end)); LatLngBounds.Builder bc = new LatLngBounds.Builder(); bc.include(init); bc.include(end); mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bc.build(), 100

How add polyline in mapView

故事扮演 提交于 2020-01-03 06:51:32
问题 I would insert in my mapview an polyline! I made it in this way CLLocationCoordinate2D coord[2]; coord[1].latitude = 45.42207; coord[1].longitude = 9.123888; coord[2].latitude = 45.422785; coord[2].longitude = 9.12377; MKPolyline *polyline = [[MKPolyline alloc] init]; polyline = [MKPolyline polylineWithCoordinates:coord count:2]; [self.mapView addAnnotation:polyline]; But don't work and there's this error: EXC_BAD_ACCESS. What's it wrong? 回答1: try this CLLocationCoordinate2D coord[2]; coord[0

How to fill area between 2 polylines in WPF with condition

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 03:22:26
问题 I am developing a charting application in which there are 2 polylines, say Polyline A (shown as red colour line in below image) and Polyline B (shown as blue colour line in below image). There can be 2 conditions in the chart: When the red line intersects the blue line from above and then stays below the blue line, I want to fill that area with some color. When the red line intersects the blue line from below and then stays above the blue line, I want to fill that area with some other color.

SVG gradient as polylines stroke background with absolute position

大兔子大兔子 提交于 2020-01-02 21:00:34
问题 Is there the ability to set absolute position of the gradient background applied to polyline? For example when I set gradient: <filter id="black-glow"> <feColorMatrix type="matrix" values= "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" /> <feGaussianBlur stdDeviation="3" result="coloredBlur" /> <feMerge> <feMergeNode in="coloredBlur" /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> to polyline's stroke: <polyline points="50,350 ... 350,239" style="fill:none;" stroke="url(#grad1)" stroke

google maps api v3: add point on polyline between two existing points on click polyline event

让人想犯罪 __ 提交于 2020-01-02 05:25:33
问题 How can I add point on a polyline between two existing points on a click polyline event? Thank you! 回答1: If you are just talking about a Polyline with only 2 points, you could use the center of a LatLngBounds containing the Polyline . Google maps api v3 doesn't implement the Polyline.getBounds() function, though. So you can extend the Polyline class to include a getBounds function: google.maps.Polyline.prototype.getBounds = function() { var bounds = new google.maps.LatLngBounds(); this