polyline

Wrong polyline drawing on map with Google Maps SDK

喜夏-厌秋 提交于 2019-12-01 00:43:41
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 objectForKey:@"routes"] objectAtIndex:0] objectForKey:@"legs"] count]) { steps = [[[[[jsonResponse

Google Maps geocoding (address to GLatLng)

帅比萌擦擦* 提交于 2019-11-30 23:29:56
I am trying to draw a geodesic polyline with Google Maps JavaScript API from two address points. var polyOptions = {geodesic:true}; var polyline = new GPolyline([ new GLatLng(), new GLatLng() ], "#f36c25", 5, 0.8, polyOptions ); map.addOverlay(polyline); if (GBrowserIsCompatible()) { map.addOverlay(polyline); } Could someone tell me how can I dynamically geocode an address into GLatLng coordinates? I am a little confused after reading Google's API documentation . Daniel Vassallo You may want to check out the following example. First it tries to geocode address1 . If it succeeds, it tries to

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

淺唱寂寞╮ 提交于 2019-11-30 20:21:51
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. 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.Marker(a, {draggable: true}).addTo(map), marker_b = new L.Marker(b, {draggable: true}).addTo(map), marker_c =

How to draw Uber polyline?

谁说胖子不能爱 提交于 2019-11-30 19:40:58
问题 Uber app has a polyline that is curved, and even includes a shadow. The shadow may be just a black with transparent polyline connecting two points. That is easy. But the second polyline with curve, how to accomplish this? Is this a Bezier curve, or a built in function like setGeodesic(true)? I have looked through the google maps examples and I see a section about circle polylines. Can this be adapted to create semi circles? Code snippet from demo. PolylineOptions options = new PolylineOptions

Google Maps geocoding (address to GLatLng)

狂风中的少年 提交于 2019-11-30 18:57:02
问题 I am trying to draw a geodesic polyline with Google Maps JavaScript API from two address points. var polyOptions = {geodesic:true}; var polyline = new GPolyline([ new GLatLng(), new GLatLng() ], "#f36c25", 5, 0.8, polyOptions ); map.addOverlay(polyline); if (GBrowserIsCompatible()) { map.addOverlay(polyline); } Could someone tell me how can I dynamically geocode an address into GLatLng coordinates? I am a little confused after reading Google's API documentation. 回答1: You may want to check out

How to track a user's location and display the path travelled using Google Maps ios SDK

£可爱£侵袭症+ 提交于 2019-11-30 15:44:14
问题 I'm currently building an ios app and I'm hoping to implement a function where the user's location is displayed on a Google Map view and when they move a polyline show's the path that has been travelled by the user so far. This obviously needs to happen in realtime. So far I've initialised a Google Maps view and can display the user's current location using the observeValueForKeyPath function. The view and location marker update as the user moves. I figured the best way to do this would be to

How do I add coordinates to an SVG polyline?

江枫思渺然 提交于 2019-11-30 15:02:36
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 this would be greatly appreciated. If you add an id attribute to the polyline so that it looks like

google map polyline is not working on android version 5.0(lollipop)

南楼画角 提交于 2019-11-30 09:52:36
问题 i am trying to draw polyline for googlemap, it is working fine upto android version 4.4(kitkat) but it is not working in android 5.0(lollipop). what to do for working in lollipop also. could you please help me hoe to resolve this issues this is my google map code public class MapLocation extends FragmentActivity implements OnMarkerClickListener { GoogleMap map; ArrayList<LatLng> markerPoints; LatLng origin,dest1,dest2,dest3; Marker marker1,marker2,marker3; PolylineOptions lineOptions = new

Arrow Mark over Polyline in Android Google Route Map

。_饼干妹妹 提交于 2019-11-30 07:30:11
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 and thus i couldn't use the locationoverlays i have also got some posts commenting as it is available in

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

家住魔仙堡 提交于 2019-11-30 07:26:50
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 polyline has been clicked? }); Does anyone know how to do this in Google Maps? thanks! Nils On the click