Grešku koju sam napisao u prethodnoj poruci javljala se prilikom promene vrednosti prvog select menija, jer se na onchange događaj select elementa poziva funkcija
draw, sada je kod izmenjen i javlja se druga greška.
Pitanje u vezi podataka koje prosleđuješ funkcijama sam postavio jer sam video problem, i dalje imaš taj problem, ti pomoću
response.routes[0].overview_path dobijaš:
https://developers.google.com/maps/d...irectionsRoute
Citat:
An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs).
|
dakle nešto kao:
Kôd:
[
new google.maps.LatLng(12.34, 56.789),
new google.maps.LatLng(87.65, 123.45)
]
a potrebno ti je:
Kôd:
[
[
{
X: 12.34
Y: 56.789
},
{
X: 87.65,
Y: 123.45
}
]
]
a ti, u tvom kodu, prosleđuješ:
Kôd:
[
[56.789, 12.34],
[123.45, 87.65]
]
Zatim sledeći problem:
http://sourceforge.net/p/jsclipper/w...on-coordinates
Citat:
B3. Scale up polygon coordinates
Because Clipper library uses integer coordinates, we have to scale up coordinates to maintain precision. The scale value should be large enough, but for performance reasons not too high. If coordinates have a precision of 2 decimals, the sufficient scale coefficient is 100.
...
|
Zatim, pogledaj u dokumentaciji za kreiranje poligona, za
PolygonOptions objekat
paths osobinu:
https://developers.google.com/maps/d...PolygonOptions
Citat:
The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths. As a result, the paths property may specify one or more arrays of LatLng coordinates. Paths are closed automatically; do not repeat the first vertex of the path as the last vertex. Simple polygons may be defined using a single array of LatLngs. More complex polygons may specify an array of arrays. Any simple arrays are converted into MVCArrays. Inserting or removing LatLngs from the MVCArray will automatically update the polygon on the map.
|
A koju vrednost ti prosleđuješ, odnosno šta dobijaš od funkcije
polys2path.
Citat:
Originalno napisao mslavko
Ovaj kod ovde: https://coderwall.com/p/zb_zdw radi to sto meni treba ali ne bas savrseno tj. ja sam isti takav kod napisao medjutim postoje odredjeni pravci, distance, gde ne radi bas najbolje
|
Može li primer, ne koristim, ali me interesuje slučaj gde ne radi, hvala.