polyline

Smooth polyline with minimal deformation

纵然是瞬间 提交于 2019-12-10 21:49:03
问题 I've got a 2D closed polyline, which is reasonably smooth. The vertices that define the polyline however are not spaced equally. Sometimes two will be very close, sometimes as many as four will be very close together. I'd like to smooth the polyline, but a regular averaging algorithm tends to shrink the area: for (int i = 0; i < (V.Length-1); i++) { PointF prev = V[i-1]; //I have code that wraps the index around. PointF next = V[i+1]; PointF pt = V[i]; float ave_x = one_third * (prev.X + next

How to remove circle from Google Maps V3?

拟墨画扇 提交于 2019-12-10 19:17:46
问题 I have drawn circle using circle = new google.maps.Circle({ map: map, radius: r, // 1 miles in metres = 1609.3 m strokeWeight:1, strokeOpacity:0.5, fillOpacity:0.2, fillColor: '#AA0000' }); circle.bindTo('center', marker, 'position'); How to remove circle from the map ? 回答1: circle.setMap(null); will remove the circle 来源: https://stackoverflow.com/questions/8260029/how-to-remove-circle-from-google-maps-v3

Algorithm - How to build a polygon around a polyline

别来无恙 提交于 2019-12-10 18:52:08
问题 I am building a web site using googles Map API. However, as I am on a shared server, I do not have access to a database with spatial extensions. Given an itinerary, which is nothing more than a series of line segments, I need to build a polygon at a given distance. For example 10km either side of the itinerary. This is the classic buffering request, which I have seen as being referenced as the " Minkowski sum " algorithm. After having searched, I have not found a working example of an

How to put Google Map labels on top?

一世执手 提交于 2019-12-10 10:58:57
问题 I am working with polylines in google map. Basically i am trying to draw a line on several roads using polyline. Now those polylines are blocking(on top) road labels. I have changed the opacity level for better viewing but i really want Google map labels on top. I have studied styling maps, but i havent found any suitable solutions. Is there a way to do it? Thanks in advance. 回答1: The tiles(which contain the ground, label, streets etc. ) are delivered as single images, not as layers, so there

Detect tap on GMSPolyline in Swift?

扶醉桌前 提交于 2019-12-10 01:36:39
问题 I'm struggling with detecting a tap on a GMSPolyline drawn on my Google map, it works just fine with GMSpolygones, but the same approach doesn't seem to work with polyline. My current approach, which works for polygones, is: if (GMSGeometryContainsLocation(coordinate, polygon.path!, false)) { ... } Any suggestions how to detect taps on a polyline? Or just close to it? 回答1: According to their API documentation, GMSPolyline inherits from GMSOverlay which means a GMSPolyline has the property

Draw poly line on the road in mkmap view - iphone

被刻印的时光 ゝ 提交于 2019-12-09 22:00:48
问题 i am making an navigation based application. In this application i am drawing a route from points selected by the user. for Calculating the route i have used Google direction API . and for drawing the route i have used this code - (void) drawRoute:(NSArray *) path { NSInteger numberOfSteps = path.count; [self.objMapView removeOverlays: self.objMapView.overlays]; CLLocationCoordinate2D coordinates[numberOfSteps]; for (NSInteger index = 0; index < numberOfSteps; index++) { CLLocation *location

Polylines on android map disappear when zoomed out

…衆ロ難τιáo~ 提交于 2019-12-09 07:43:45
I am using the code below to draw a bunch of vertical lines at 5 degree intervals on a Google map (android API v2). All works great until zooming out to approximately zoom level 5.1, at which point all my lines disappear. Is this a bug in my code, or something that the maps API does on purpose? How can I get these lines to show up at all zoom scales? Thanks very much. if (gMap != null) { double lat = loc_service.getLatitude(); double lng = loc_service.getLongitude(); LatLngBounds bounds = new LatLngBounds(new LatLng(lat-(MAP_WIDTH/2), lng-(MAP_WIDTH/2)), new LatLng(lat+(MAP_WIDTH/2), lng+(MAP

Android Map: How to animate polyline on Map?

房东的猫 提交于 2019-12-09 06:53:14
问题 When I plot my polyline on Map from point A -> B, I have a requirement to draw the polyline with animation. As if from A-> B the polyline keeps on drawing. I have used below link for reference: https://github.com/amalChandran/google-maps-route-animation Using the solution I am able to animate the polyline, but the polyline itself is not proper. It doesn't go through road. Original APK of the solution also has the same bug. Can someone pls help me with a suitable solution 回答1: You can try with

Algorithm to find intersections between polylines

一曲冷凌霜 提交于 2019-12-09 06:15:41
问题 Bentley-Ottmann algorithm works for finding intersections of set of straight lines. But I have lot of polylines: Is there a way to find intersections of the set of polylines? I'm figuring out, but in the meanwhile, if someone can give some pointers or ideas, that would be helpful. Thanks for reading. By the way, I'm using WPF/C# and all the polylines are PathGeometry. Source of the Image: http://www.sitepen.com/blog/wp-content/uploads/2007/07/gfx-curve-1.png 回答1: The sweep line algorithm has

draw polyline on walked route google maps android

只谈情不闲聊 提交于 2019-12-08 21:40:31
i'm kind of new to android and i'm developing an app where the user walks and i want to draw a polyline while the user is walking here's what i have done so far MapClass package com.T471.stayfit; import android.content.Context; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesClient;