polyline

Visvalingam-Whyatt polyline simplification algorithm clarification

蹲街弑〆低调 提交于 2019-12-20 10:42:14
问题 I'm trying to implement a polyline simplification algorithm. The original article can be found here: http://archive.is/Tzq2. It seems straightforward in concept but I don't understand the sample algorithm (I think it's poorly worded) pseudocode supplied and was hoping someone could provide some insight. From the article, I gathered that the basic idea is to Calculate the effective area (formed by the triangle between three consecutive points on a line) for each point and delete those with 0

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

拟墨画扇 提交于 2019-12-20 07:33:12
问题 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? 回答1: 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

Multiple MKPolyline on MKMapView iOS6

别等时光非礼了梦想. 提交于 2019-12-20 05:55:23
问题 I am working with MKMapView to draw route using MKPolyline , I am able to draw single route with an array of waypoints.Now I want to draw multiple MKPolyline s on the MKMapView for instance, A blue MKPolyline from 28.102021, 77.10129 to 28.20320, 77.3021 and A red MKPolyline from 28.50930, 77.89192 to 28.60291, 77.87328 . How can I achieve this ? Code: - (void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init]; locationManager.desiredAccuracy = 6.0;

Google Maps API: Setting up callbacks for adding markers/polyline

本小妞迷上赌 提交于 2019-12-19 10:21:18
问题 I'm trying to add a polyline to the Google Map generated. The coordinates for the polyline are taken from a JSON file on my web server using jQuery (getJSON function). However, I'm having trouble with callbacks. I've defined three functions in a separate JavaScript file, and these are: function initMap(callback) { map = new google.maps.Map(document.getElementById('map-canvas'), { center: {lat: 34.397, lng: 150.644}, scrollwheel: false, zoom: 2 }); callback(); } . function setPath(callback) {

Wrong polyline drawing on map with Google Maps SDK

跟風遠走 提交于 2019-12-19 04:14:45
问题 I'm trying to draw route on my map using Google Maps SDK. This is the URL that i'm calling and I parse the JSON response to array of coordinates: id jsonResponse = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; int points_count = 0; points_count = [[[[[[jsonResponse objectForKey:@"routes"] objectAtIndex:0] objectForKey:@"legs"] objectAtIndex:0] objectForKey:@"steps"] count]; NSArray *steps = nil; if (points_count && [[[[jsonResponse

Create a polygon around a polyline like a buffer

a 夏天 提交于 2019-12-19 03:55:37
问题 I have looked around to find an example of how to take a polyline and create a buffer around it so I end up with a polygon. So far I found out I need Minkowskis Sums to do so, but I can't get my head around to raw algorithm and translate that in to code. I would prefer an example in C# or a walkthrough of the algorithm. 回答1: You could use the OffsetPolygons() function in the Clipper library, but first you'd need to convert the polyline into a polygon. Do this by appending to the polyline a

Leaflet - How to match marker and polyline on drag and drop

旧时模样 提交于 2019-12-19 02:06:22
问题 I have a project with leafletJS. For example, I have 2 points (A, B) in map. I display it as 2 Markers I must draw a polyline from A to B. I moved marker A and I want to the head of polyline of marker A match to marker A (moved follow marker A). How can I do this? Sorry for my bad English. Thanks all very much. Truong M. 回答1: Given the following L.Latlng 's, L.Marker 's and L.Polyline : var a = new L.LatLng(-45, -90), b = new L.LatLng(45, 0), c = new L.LatLng(-45, 90); var marker_a = new L

Arrow Mark over Polyline in Android Google Route Map

倾然丶 夕夏残阳落幕 提交于 2019-12-18 12:43:30
问题 how to show Arrowheads over Polyline in Android Google map v2 I have gone through couple of links , most of them gives link to JS https://google-developers.appspot.com/maps/documentation/javascript/examples/overlay-symbol-arrow but I need in Android not JS and I can't use those codes in Android Some are using MapActivity I followed a tutorial to creat map activity too https://developers.google.com/maps/documentation/android/v1/hello-mapview but it didnt work I can't generate the mapactivity

Animate google maps polyline

若如初见. 提交于 2019-12-18 10:18:09
问题 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 to the destination. Any hints ? Where should I start ? Any help is really appreciated. 回答1: I've had some success with the following: var departure = new google.maps.LatLng(dept_lat, dept_lng); //Set to whatever lat/lng you need for your departure

Google directions api overview polyline not working

微笑、不失礼 提交于 2019-12-18 09:38:14
问题 I'm trying to show a path from the google maps directions api on a google maps static map. The url for the directions api call looks like this: https://maps.googleapis.com/maps/api/directions/json?origin=lübeck&destination=hamburg&key=MY_API_KEY I get a valid json response containing all the informations. I then want to show the encoded polyline for the path overview on a static map with this api call: https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=860x600&path=enc:THE