polyline

Google Maps API v3 remove all polylines

柔情痞子 提交于 2019-11-27 13:53:25
问题 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,

Highlighting borders of state and cities of US in Google Map API 3

青春壹個敷衍的年華 提交于 2019-11-27 13:13:15
I have a scenario where I have to highlight borders and shade a state or city after geocoding it (when I got the lang and lat). How can I do this, do I need to have a complete information of a city to surround it with polylines? Or is there a way that map API can do this for me. True. Google does not provide this feature. So what we can do... we can have the lat/long of the borders of the state. And we have to draw polygons ourselves. I used this JS object. And changed it to Google map object ( google.maps.LatLng ). For example: var statesobj = {"AK": [new google.maps.LatLng(70.0187, -141.0205

How to add markers on Google Maps polylines based on distance along the line?

不问归期 提交于 2019-11-27 10:42:05
I am trying to create a Google Map where the user can plot the route he walked/ran/bicycled and see how long he ran. The GPolyline class with it’s getLength() method is very helpful in this regard (at least for Google Maps API V2), but I wanted to add markers based on distance, for example a marker for 1 km, 5 km, 10 km, etc., but it seems that there is no obvious way to find a point on a polyline based on how far along the line it is. Any suggestions? Daniel Vassallo Having answered a similar problem a couple of months ago on how to tackle this on the server-side in SQL Server 2008, I am

Polyline using DataBinding and PointCollection for continuous update

匆匆过客 提交于 2019-11-27 06:15:34
问题 first of all I describe my objective I want to achive. I want to visualise a continuous data stream (maximum 1000 values per second but could be reduced). This data stream should be visualised as a chart - being more precise it's a visualisation of an ECG among other things. My first idea was using polyline and bind it to a point collection. The problem here is that nothing is shown on the UI. Perhaps it's a wrong aproach for this task. Better ideas are welcomed. Here ist my code so far.

Get point on a path or polyline which is closest to a disconnected point

不问归期 提交于 2019-11-27 02:58:47
问题 I have a point and a path, polyline, or set of points to create lines. How can I find the point on my path which closest to another disconnected point? It's easy to store or transfer my path / polyline as any of the WPF geometry controls, but do any of these controls come with GetDistanceFrom type methods? Is there any simply way to achieve this goal? 回答1: Here is the algorithm that I've implemented as a solution. There's nothing 'non-obvious' in here if you've spent more than ten minutes

Decoding polyline with new Google Maps API

左心房为你撑大大i 提交于 2019-11-27 00:23: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

Map View draw directions using google Directions API - decoding polylines

独自空忆成欢 提交于 2019-11-26 22:02:55
I'm trying to use the Google directions API to show directions on my mapview but I am having difficulties getting the data from the JSON response. I can get the "levels" and "points" strings but can't work out how to decode them to points on the map. Any help would be much appreciated. Kenny I have a class which can decode them for you, add the class below then call in your code like this: int[] decodedZoomLevels = PolylineDecoder.decodeZoomLevels(levels); GeoPoint[] gPts = PolylineDecoder.decodePoints(points, decodedZoomLevels.length); where points and levels are the data you've extracted

How to detect a click on a polyline

烈酒焚心 提交于 2019-11-26 17:02:04
问题 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() { } }); 回答1: 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

Highlighting borders of state and cities of US in Google Map API 3

蹲街弑〆低调 提交于 2019-11-26 11:06:54
问题 I have a scenario where I have to highlight borders and shade a state or city after geocoding it (when I got the lang and lat). How can I do this, do I need to have a complete information of a city to surround it with polylines? Or is there a way that map API can do this for me. 回答1: True. Google does not provide this feature. So what we can do... we can have the lat/long of the borders of the state. And we have to draw polygons ourselves. I used this JS object. And changed it to Google map

Map View draw directions using google Directions API - decoding polylines

自闭症网瘾萝莉.ら 提交于 2019-11-26 08:09:50
问题 I\'m trying to use the Google directions API to show directions on my mapview but I am having difficulties getting the data from the JSON response. I can get the \"levels\" and \"points\" strings but can\'t work out how to decode them to points on the map. Any help would be much appreciated. 回答1: I have a class which can decode them for you, add the class below then call in your code like this: int[] decodedZoomLevels = PolylineDecoder.decodeZoomLevels(levels); GeoPoint[] gPts =