$.ajax({ url: "/Home/GetPolyline", type: "GET", contentType: "application/json; charset=utf-8", datatype: JSON, success: function (result) { //result=0:{latitud: "-21.532962", longitud: "-64.742054"} // 1:{latitud: "-21.532713", longitud: "-64.740906"} // 2:{latitud: "-21.532753", longitud: "-64.740069"} // 3:{latitud: "-21.532810", longitud: "-64.739021"} alert("you are here") var myPosition = new google.maps.LatLng(-21.532863, -64.741526); //var myPosition = new google.maps.LatLng(-21.578561, -64.690277); var points = new google.maps.MVCArray(); points = result; var cascadiaFault = new google.maps.Polyline({ points }); cascadiaFault.setMap(map); if (google.maps.geometry.poly.isLocationOnEdge(myPosition, cascadiaFault, 0.001)) { alert("Relocate!"); } else { alert("you are in route") // } }, error: function (data) { } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)