polyline

How do I add coordinates to an SVG polyline?

断了今生、忘了曾经 提交于 2019-11-29 21:09:17
问题 How do I add coordinates to an existing SVG polyline with JavaScript? <svg height="240" width="700" id='svg'> <polyline points="0, 240 40, 25 60, 40 80, 120 120, 140 200, 180 500, 120 600, 5" style="fill:none;stroke:#000;stroke-width:3" /> </svg> I am using IE 9 (in a .hta file) and need to be able to dynamically append new points to the polyline. The goal is to be able to create a line graph. I apologize in advance, I have absolutely no idea how to reference this attribute. Any guidance for

Animate google maps polyline

情到浓时终转凉″ 提交于 2019-11-29 20:31:00
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. 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 location var arrival = new google.maps.LatLng(arr_lat, arr_lng); //Set to whatever lat/lng you need for your

Google directions api overview polyline not working

只愿长相守 提交于 2019-11-29 18:09:31
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_ENCODED_POLYLINE The static map won't show the path. I suspect that the encoded polyline returned by the

Google Maps v2 - draw route with different colors - Android

巧了我就是萌 提交于 2019-11-29 18:08:36
I am building a location based android app and I want to draw a route user takes based on his speed. For example: 0-10kmh - Yellow polyline 10-20kmh - Red polyline Now I run everything in background service and I update Map Activity; Location Service : if (location.getSpeed() >0 && location.getSpeed < 10) { yellowPolyLineArray.add(new LatLng(location.getLatitude(), location.getLongitude())); polylineIntent.putParcelableArrayListExtra("yellow",yellowPolyLineArray); }else if (location.getSpeed() >10 && location.getSpeed < 20) { redPolyLineArray.add(new LatLng(location.getLatitude(), location

KML opens with the wrong geoposition

此生再无相见时 提交于 2019-11-29 17:50:15
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/2.2"> <Document> <name>Stockholms T-bana</name> <description>Karta över röda linjen i Stockholms T

How to display curved polyline on one side of a straight line?

萝らか妹 提交于 2019-11-29 16:52:05
This question is related to this SO question and answered by @geocodezip. A problem I have is drawing a line from either north-to-south or south-to-north. The curved line is now bent like number 8 or a S. How do I control the curved line to display on one side of the straight line. Sometimes the curved line is expanded beyond the starting point and contracted at the ending point. Thanks. Here are my codes. I have two sample polylines north-to-south. var map; function init() { var Map = google.maps.Map, LatLng = google.maps.LatLng, LatLngBounds = google.maps.LatLngBounds, Marker = google.maps

google maps circle to polyline coordinate array

寵の児 提交于 2019-11-29 15:19:31
how to get array of polyline coordinates from google.maps.Circle 's object there is no api doc entry about that 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 the raidus in lat/lon var rlat = (radius / earthsradius) * r2d; var rlng = rlat / Math.cos(point.lat() * d2r);

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

帅比萌擦擦* 提交于 2019-11-29 10:41:48
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 I use to create an MKPolyline from the loaded coordinates -(IBAction)didClickLoadCoordinates:(id)sender

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

无人久伴 提交于 2019-11-29 09:37:06
问题 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. routePath = new google.maps.Polyline({ path: routeCoordinates, strokeColor: "#CC33FF", strokeWeight: 3 }); routePath.setMap(map); google.maps.event.addListener(routePath, 'click', function() { alert(routePath); // TODO: display which section of the

Draw polyline using Swift

非 Y 不嫁゛ 提交于 2019-11-29 08:48:58
问题 I'm trying to get an understanding of how to draw polylines using Swift. I've looked at the documentation, referenced some tutorials, and checked out some other SO posts, but I still can't get the thing to draw a line on my map. Here's my code. Anyone tell me what I'm doing wrong here? import UIKit import MapKit class FirstViewController: UIViewController { @IBOutlet weak var map: MKMapView! override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) let location =