Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle maps direction renderer exact match only
    primarykey
    data
    text
    <p>I am using DirectionRenderer(gmap3) to show the user directions. The problem is it shows a match even if it cannot find an exact match. Eg: SomeFakePlace, myRealCity will match myRealCity even if it cannot match SomeFakePlace. </p> <p>So it shows the directions from City's center to the place, instead. The destination is fixed(myLatLng)</p> <p>I want it to return null and not show a route if cannot find one. I have decent error display to handle that. </p> <pre><code> $("#map-canvas-single").gmap3({ getroute:{ options:{ origin:$("#directions-from").val(), destination:myLatlng, travelMode: google.maps.DirectionsTravelMode.DRIVING }, callback: function(results){ console.log(results); var point= results.routes[0].overview_path[0] window.directionMarker = new google.maps.Marker({ position: new google.maps.LatLng(point.jb,point.kb), title:$("#directions-from").val(), //icon:"http://maps.google.com/mapfiles/ms/icons/&lt;?php if($this-&gt;listing-&gt;type=="pg"):?&gt;green&lt;?php else: ?&gt;purple&lt;?php endif;?&gt;-dot.png" }); window.directionMarker.setMap($(this).gmap3("get")); if(!results) noty({text:"Place not found!",type:"error"}); else { $(this).gmap3({ directionsrenderer:{ container: $("#directions-container"), id:"directions", options:{ directions:results, suppressMarkers :true //&lt;&lt;Look here&gt;&gt; } } }); } } } }); </code></pre> <p>The code works fine and all. I think this the fault of direction renderer service, not gmaps. I am sure htere must be some parameter for an exact match</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload