polyline

How to display curved polyline on one side of a straight line?

不想你离开。 提交于 2019-12-18 09:26:20
问题 This question is related to this SO question and answered by @geocodezip. A problem I have is drawing a line from either north-to-south or south-to-north. The curved line is now bent like number 8 or a S. How do I control the curved line to display on one side of the straight line. Sometimes the curved line is expanded beyond the starting point and contracted at the ending point. Thanks. Here are my codes. I have two sample polylines north-to-south. var map; function init() { var Map = google

Draw ARC Polyline in Google Map

会有一股神秘感。 提交于 2019-12-18 05:49:04
问题 How Can I Draw Arc Polyline in Google Map ? I already used this code to create curved Polyline. Here is the method to draw curved Polyline: private void showCurvedPolyline (LatLng p1, LatLng p2, double k) { //Calculate distance and heading between two points double d = SphericalUtil.computeDistanceBetween(p1,p2); double h = SphericalUtil.computeHeading(p1, p2); //Midpoint position LatLng p = SphericalUtil.computeOffset(p1, d*0.5, h); //Apply some mathematics to calculate position of the

convert bezier curve to polygonal chain?

故事扮演 提交于 2019-12-17 23:23:54
问题 I want to split a bezier curve into a polygonal chain with n straight lines. The number of lines being dependent on a maximum allowed angle between 2 connecting lines. I'm looking for an algorithm to find the most optimal solution (ie to reduce as much as possible the number of straight lines). I know how to split a bezier curve using Casteljau or Bernstein polynomals. I tried dividing the bezier into half calculate the angle between the straight lines, and split again if the angle between

Styling a Google Maps v3 Polyline with Dashes or Dots?

对着背影说爱祢 提交于 2019-12-17 22:24:13
问题 I'd like to take a Google Map v3-based map with some custom polylines, and make some of those lines dotted or dashed. I can't seem to find any way of doing this. Is it possible, and if so, how? 回答1: This feature has been added to Polyline options, and it's called Symbols on Polylines Creating a dashed line looks like this (demo): var lineCoordinates = [ new google.maps.LatLng(22.291, 153.027), new google.maps.LatLng(18.291, 153.027) ]; var lineSymbol = { path: 'M 0,-1 0,1', strokeOpacity: 1,

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

不问归期 提交于 2019-12-17 10:15:28
问题 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? 回答1: Having answered a similar problem a

WPF, Polygon and Poly

↘锁芯ラ 提交于 2019-12-14 03:53:32
问题 I'm building an aplication C# with WFP, I'm trying to draw shapes, each shape belongs to a class and such class contains a Polygon for the outer shape, and 1 to 3 Polylines to make it look like real 2D object, this way I can change some properties of the whole shape on the fly (Colors, Visibility, etc) I must say that some Polylines are created by a loop according to the desired height and width but righ now I'm facing a probem with the render of some PolyLines If you use paint to represent

google map polyline infowindow

[亡魂溺海] 提交于 2019-12-14 03:32:06
问题 As continuation to this question, i trying to add the respective json object name to infowindow content as, var infowindow = new google.maps.InfoWindow({ content:i }); Which is given in this fiddle but it displays only the name of last object. I also tried with return function as google.maps.event.addListener(poly, 'click', (function(event, (poly, i)) { return function() { infowindow.open(map); infowindow.setPosition(event.latLng); } })(poly, i)); but no use (fiddle). How can I achieve it?

How to generate encoded polylines from shapefile/ kml?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 19:15:55
问题 I need to convert a shapefile/ kml to encoded polyline format for a certain project. Does anyone know of a simple conversion tool or code that achieves the same ? 回答1: You'll first want to convert your KML/SHP to a list of lat/long pairs. For KML, you can simply open the KML file in an editor to get the lat/long pairs. For SHP, you can first use shp2kml to convert to KML. Then, use the encoding library in the Maps API, or you can write your own encoder using the algorithm. 回答2: Your term

Google map Android API v2 - InfoWindow on polyline?

。_饼干妹妹 提交于 2019-12-13 13:07:42
问题 I am drawing polyline on my map,I need to show some data to user now. How I can draw text or InfoWindow on each polyline ? I add polyline like : ArrayList<LatLng> points = null; PolylineOptions lineOptions = null; MarkerOptions markerOptions = new MarkerOptions(); // Traversing through all the routes for(int i=0;i<result.size();i++){ points = new ArrayList<LatLng>(); lineOptions = new PolylineOptions(); String color = colors[i % colors.length]; // Fetching i-th route List<HashMap<String,

Google Maps: Select previous Marker on Polyline

自闭症网瘾萝莉.ら 提交于 2019-12-13 10:39:01
问题 I'm doing an application with google maps API that have a JSON with the marker's coordinates. Then I draw polylines between the markers. I also implemented a function with a onclick event that creates a new marker inside the polyline. This marker has to show information of the previous marker in the polyline (the one taked of the JSON, not a clicked one). But I don't know how to take the previous vertex(marker) of a selected polyline. Code: (function() { window.onload = function() { var