polyline

Google Maps API v3 remove all polylines

跟風遠走 提交于 2019-11-28 23:12:56
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 with polylines and trying to create the same concept here with the polylines , however I am having a difficult time. Here is what I have: // Global variable for array of lines var points= []; Setup my points. line1 = new google.maps.LatLng(line1Start, line1Finish); line2 = new google.maps.LatLng(line2Start, line2Finish); line3 = new google.maps.LatLng

Find nearest point in polyline/path

雨燕双飞 提交于 2019-11-28 22:11:49
I need to find nearest point from given CLLocationCoordinate2D on array of GMSPolyline . I can convert this to GMSPath if that's better. Is there any ready method (or any repository) for such calculations? I have some problems with implementation. I wonder how to create an algorithm: 1. for all polylines 1.1. find smallest distance between polyline and touch point, save CLLocationCoordinate2D 2. for all distances from point 1.1. 2.1. find the shortest one, it's CLLocationCoordinate2D is our point Now the question is how to achieve point 1.1..? Basing on SOF shortest distance question , I wrote

KML opens with the wrong geoposition

和自甴很熟 提交于 2019-11-28 12:00:31
问题 I'm trying to create a map of the Stockholm's subway lines in Fusional Tables. In the Fusion Tables I created a map with geo each station: https://www.google.com/fusiontables/DataSource?docid=1K7F2DMY5JBA6ZQOH8a1a4dQjwxoksRDMJ3-wPEg#map:id=3 I want to connect them to the polyline. Options to create polylines and way in the tables there, or they are very well hidden. So I created this KML file and loaded into tables: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml

google maps circle to polyline coordinate array

佐手、 提交于 2019-11-28 09:34:43
问题 how to get array of polyline coordinates from google.maps.Circle 's object there is no api doc entry about that 回答1: A google.maps.Circle doesn't contain an array of coordinates. If you want a google.maps.Polygon that is shaped like a circle, you need to make one. function drawCircle(point, radius, dir) { var d2r = Math.PI / 180; // degrees to radians var r2d = 180 / Math.PI; // radians to degrees var earthsradius = 3963; // 3963 is the radius of the earth in miles var points = 32; // find

iOS MapKit connect multiple points on map over roads

老子叫甜甜 提交于 2019-11-28 05:50:20
问题 I'm using this code to connect pins(points on map) with polyline: CLLocationCoordinate2D coordinates[allLocations.count]; int i = 0; for (locHolder *location in allLocations) { coordinates[i] = CLLocationCoordinate2DMake([location.lat floatValue], [location floatValue]); i++; } MKPolyline *polyline = [MKPolyline polylineWithCoordinates:coordinates count:[allLocations count]]; self->polyline = polyline; [self.mapView addOverlay:self->polyline level:MKOverlayLevelAboveRoads]; But this code

Decoding polyline with new Google Maps API

牧云@^-^@ 提交于 2019-11-28 04:24:12
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 urlString.append(Double.toString(src.latitude)); urlString.append(","); urlString.append(Double.toString(src.longitude)); urlString.append("&destination=");// to urlString.append(Double.toString(dest.latitude)); urlString.append(","); urlString.append(Double.toString(dest.longitude)); urlString.append("&sensor=false&mode="); if (tipo != null) { urlString

How do you store data from NSMutable Array in Core Data?

人盡茶涼 提交于 2019-11-28 04:05:44
问题 The app i'm making draws a Polyline based on the users coordinates from CLLocationManager (these are all kept in an NSMutableArray ) When the app closes, the current polyline disappears. How can I store the array of points in CoreData to be retrieved when the app starts up? All of the past 'routes' that the user has taken since initiating the app should be recovered and overlaid on the map (which may be quite a lot, so CoreData seems the best option from what i've gathered). This is the code

Draw polyline using Google Maps in custom view with Swift 3

a 夏天 提交于 2019-11-27 18:41:18
问题 I am trying to draw route between two places using Google Maps on a custom UIView but not able to get it correctly implemented. My custom view is mapViewX. I've installed google sdk using pods which includes pod 'GoogleMaps' and pod 'GooglePlaces'. I made custom-view Class as 'GMSMapView'. my code is : @IBOutlet weak var mapViewX: GMSMapView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let path = GMSMutablePath()

How to detect a click on a polyline

我只是一个虾纸丫 提交于 2019-11-27 15:04:30
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 LatLng(51.7, 0.3)) .width(5) .color(Color.RED)); googleMap.setOnMapLongClickListener(new OnMapLongClickListener() { } }); Unfortunately there's no such thing as a polyline click listener so you'll have to listen to clicks on map and check if a click was registered on any of your polylines. You'll also have to save references to the polylines you added to

Find nearest point in polyline/path

社会主义新天地 提交于 2019-11-27 14:16:01
问题 I need to find nearest point from given CLLocationCoordinate2D on array of GMSPolyline . I can convert this to GMSPath if that's better. Is there any ready method (or any repository) for such calculations? I have some problems with implementation. I wonder how to create an algorithm: 1. for all polylines 1.1. find smallest distance between polyline and touch point, save CLLocationCoordinate2D 2. for all distances from point 1.1. 2.1. find the shortest one, it's CLLocationCoordinate2D is our