directions

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

how to draw a google maps waypoint with multi-colored polylines

时间秒杀一切 提交于 2019-11-28 05:40:44
问题 Hi I try to draw polylines with directions waypoints on google maps . I tried something like that. My draw I want to draw the routes with different colors like this. Google maps directions example ss I wrote this sample code . function initMap() { var directionsService = new google.maps.DirectionsService; var directionsDisplay = new google.maps.DirectionsRenderer; var map = new google.maps.Map(document.getElementById('map'), { zoom: 6, center: {lat: 41.85, lng: -87.65} }); directionsDisplay

Swift iOS google Map, path to coordinate

天大地大妈咪最大 提交于 2019-11-27 13:50:11
I am trying to create a function in my app that will guide the user to a marker I have created. This is the code I am using, it works great, It gets the users current location and show it on the map. But how can I get a directions to a marker? Any awnser will be helpful class Karta: UIViewController, CLLocationManagerDelegate { @IBOutlet var mapView: GMSMapView! let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() //allow app to track user locationManager.delegate = self locationManager.requestWhenInUseAuthorization() //set out a marker on the map var

Highlight a specified route on Google Maps v2 Android

孤者浪人 提交于 2019-11-27 11:23:12
问题 Right, so I'm currently using the Google Directions API in my app to retrieve the route between two locations. When I send a request for a route directions, I retrieve a number of details in JSON regarding the route including the names of every road along the route, their corresponding start and end lat-long co-ordinates, and their polyline value. For example: If I send the request http://maps.googleapis.com/maps/api/directions/json?origin=redfern+ave,+dublin&destination=limetree+ave,+dublin

How do I get JSON from google directions api using jQuery?

最后都变了- 提交于 2019-11-27 08:43:37
问题 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery.getJSON demo</title> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <script> APIKEY = "AIzaSyC1CCvx0HI78PGLWpO-R67s8r7A0zckEyc"; requestURL = "https://maps.googleapis.com/maps/api/directions/json?origin=Brooklyn&destination=Queens&mode=transit&key=" + APIKEY + "callback=?"; $.ajax({ url: requestURL, type: "GET", dataType: 'jsonp', cache: false, success: function(response){ alert

Displaying multiple routes using Directions API in Android

╄→尐↘猪︶ㄣ 提交于 2019-11-27 02:03:45
问题 I am using this class to display a route on a map. The problem is that it only displays one route. What I want to do is display multiple alternate routes on the map. Even thought the server response has multiple routes, it only parses the first route and displays it. What changes should I make to display all the routes that the google server returns.Here is my class. public class GMapV2Direction { public final static String MODE_DRIVING = "driving"; public final static String MODE = "walking"

Swift iOS google Map, path to coordinate

和自甴很熟 提交于 2019-11-26 16:34:09
问题 I am trying to create a function in my app that will guide the user to a marker I have created. This is the code I am using, it works great, It gets the users current location and show it on the map. But how can I get a directions to a marker? Any awnser will be helpful class Karta: UIViewController, CLLocationManagerDelegate { @IBOutlet var mapView: GMSMapView! let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() //allow app to track user

Get driving directions using Google Maps API v2

倖福魔咒の 提交于 2019-11-26 03:19:55
问题 I am trying to get the driving direction between the two positions: LatLng(12.917745600000000000,77.623788300000000000) LatLng(12.842056800000000000,7.663096499999940000) The code which i have tried: Polyline line = mMap.addPolyline(new PolylineOptions(). add(new LatLng(12.917745600000000000,77.623788300000000000), new LatLng(12.842056800000000000,7.663096499999940000)) .width(5).color(Color.RED)); But this draws a straight line between the two points . Is there any other method/way to get