google-polyline


jquery-ui-map fit bounds with a polyline?

点点圈 提交于 2020-01-04 09:03:15
问题 I'm working on a mobile app using jQuery Mobile. I also you the plugin "jquery-ui-map" to do my map (that helped alot with display issues using only GMap with jQM). I'm able to add polyline on the map and it works just fine. But when I try to use the fitBounds method, it doesn't work. In fact, it zoom out alot. But not on my bounds. Here is my code : // Added some data, so you can understand the structure // of variable "plan" plan[0].lat_a = 45.4681; plan[0].lng_a = -73.7414; plan[0].lat_b =

Strange ArrayIndexOutOfBoundsException on some devices while drawing polylines

陌路散爱 提交于 2020-01-03 15:20:07
问题 Below is the code that I am using to draw routes. Whenever the user pauses the workout I want to show this path as pink polyline. I therefore made my own interface named MapHelper and taken one boolean as isPause and lastPause . When the user saves his/her workout I save all route points as array and on typical list I am displaying this maps as feeds and for that I am using lite mode version of Googlemap. Below is my adapter class Adapter.java public class FeedsAdpter extends RecyclerView

How to put a infowindow on polyline in Google Maps v3?

只愿长相守 提交于 2019-12-30 17:31:28
问题 I want to know how to show infowindow on polyline in using Google Maps Api V3 ? and to appear in the middle of the polyline ?! 回答1: Firstly you will need to calculate the middle/center of the polyline. This has been discussed and answered here; https://stackoverflow.com/a/9090409/787921 Then you will have to open the infowindow; var infowindow = new google.maps.InfoWindow({ content: "infowindow text content"}); infowindow.setPosition(midLatLng); infowindow.open(map); 回答2: find the middle

How to dynamically add polylines from an arraylist

自古美人都是妖i 提交于 2019-12-28 16:23:23
问题 I have an places = ArrayList<ArrayList<LatLng>> I am adding LatLng points into the inner ArrayList and then I have a for loop that loops and adds polylines to the map.. except it doesnt do that... How can I add polylines dynamically to the GoogleMap? I checked whether or not places was being populated and it is. Thanks in advance. ArrayList<Polyline> pl = new ArrayList<Polyline>(); for(int i =0; i<places.size(); i++){ pl.add(mMap.addPolyline(new PolylineOptions().addAll(places.get(i)))); Log

How to dynamically add polylines from an arraylist

人盡茶涼 提交于 2019-12-28 16:23:19
问题 I have an places = ArrayList<ArrayList<LatLng>> I am adding LatLng points into the inner ArrayList and then I have a for loop that loops and adds polylines to the map.. except it doesnt do that... How can I add polylines dynamically to the GoogleMap? I checked whether or not places was being populated and it is. Thanks in advance. ArrayList<Polyline> pl = new ArrayList<Polyline>(); for(int i =0; i<places.size(); i++){ pl.add(mMap.addPolyline(new PolylineOptions().addAll(places.get(i)))); Log

OTP encoded polyline same as Google encoded polyline?

Deadly 提交于 2019-12-25 14:06:30
问题 I have been researching and trying to make sense. My question: are the encoded polylines that Google gives in its directions api same as the leg geometry encoded polylines of Open Trip Planner? 回答1: Late answer, but yes, Open Trip Planner returns google Encoded Polyline format. You can check this link for reference https://groups.google.com/forum/#!topic/opentripplanner-dev/kuR6fM3fY7I 来源: https://stackoverflow.com/questions/27045701/otp-encoded-polyline-same-as-google-encoded-polyline

Google map polyLine not clearing

自闭症网瘾萝莉.ら 提交于 2019-12-25 14:03:07
问题 I have a sample google map here where I can draw a polyline and drag the marker to redraw the polyline. When I'm dragging the marker, I'm using Path.setMap(null) to redraw the Polyline as, google.maps.event.addListener(marker, 'dragend', function(event) { var newLatLng = event.latLng; var index = Latlngs.map(function(element) { return element[0]; }).indexOf(marker.id); if (index !== -1) { Latlngs[index] = [marker.id, newLatLng]; } console.log(Latlngs); var changedLine=[]; for (var i = 0; i <

polyline not visible in google maps

≯℡__Kan透↙ 提交于 2019-12-25 00:35:35
问题 I am trying to add polyline connecting a group of points in google maps.When i build the app I am not getting any error but polyline does not appear.If i call isvisible() method it returns true.Please Help @Override public void onMapReady(GoogleMap googleMap) { // new LongOperation().execute(""); /* googleMap.setMapStyle( MapStyleOptions.loadRawResourceStyle( this, R.raw.mapjson));*/ if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager

how to get lat lng of position click on polyline?

≯℡__Kan透↙ 提交于 2019-12-24 08:29:16
问题 I am getting setOnPolylineClickListener by following method. mMap.setOnPolylineClickListener(new GoogleMap.OnPolylineClickListener() { @Override public void onPolylineClick(Polyline polyline) { } But this returns whole Polyline I want Latitude and Longitude of click position like we get by MapClickListener how to achieve this ? mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(final LatLng point) { }); I have tried using PolyUtil with following

How to add a random point inside a polygon in Google Maps?

霸气de小男生 提交于 2019-12-23 03:44:25
问题 I have a bounds to a place and created a polygon of that place. How can I generate a random point inside the bounds of that polygon? 回答1: One way of doing it. This will calculate the bounds of the polygon, then guess a random point inside that bounds, if the point is contained by the polygon, it will put a marker there. // calculate the bounds of the polygon var bounds = new google.maps.LatLngBounds(); for (var i=0; i < polygon.getPath().getLength(); i++) { bounds.extend(polygon.getPath()

工具导航Map