google-polyline

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()

Google Maps API v3 SVG markers disappear

ⅰ亾dé卋堺 提交于 2019-12-20 10:27:08
问题 I am using SVG path notation to create markers along with a polyline using Google Maps API v3. Sometimes, after adding a few markers, they just stop showing from the map. If I pan the map, even just 1px, they show again. SVG markers stop showing after adding a few SVG markers show again after pan This happens in FF, Safari, Chrome and iPhone browsers. Here is my code for the polyline: var lineSymbol = { path: g.SymbolPath.FORWARD_OPEN_ARROW, scale:1.5 }; polyOptions = { strokeColor: '#0026b3'

passing values to JavaFX from javascript

亡梦爱人 提交于 2019-12-20 06:36:12
问题 As this is my first post , forgive any inaccuracies. My problem , i want to pass the value from an javascript function to Javafx on the initialize method public void initialize(URL arg0, ResourceBundle arg1) { // TODO Auto-generated method stub final URL urlGoogleMaps = getClass().getResource("googlemaps.html"); System.out.println("fjdsoij"); browser.getEngine().load(urlGoogleMaps.toExternalForm()); WebEngine webEngine = browser.getEngine(); webEngine.getLoadWorker().stateProperty()

Drawing route partially not getting required output in iPhone MapView

柔情痞子 提交于 2019-12-20 05:46:51
问题 I am trying to draw route between two points using polyline . I got somewhat route but not correct and I think it will get confused at the turn . I am using google api for getting points of route .Following is code what i tried please check . - (IBAction)onclickDrawButton:(id)sender { flag=TRUE; NSString *startpoint=[satrtTextfield text]; NSString *endpoint=[endTextfield text]; NSMutableString *urlString=[NSMutableString stringWithFormat:@"http://maps.googleapis.com/maps/api/directions/json