bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
495 stars 235 forks source link

fullMapStart + inlineDirections bug #52

Closed milansimek closed 9 years ago

milansimek commented 9 years ago

When fullMapStart is enabled, inline directions don't work.

I fixed is by changing the following:

in method directionsRequest on line 1032:

Change:

if(destination) {

to:

if(destination && origin) {

Maybe there is a more elegant fix, but this works for me at the moment.

Thanks for the great plugin by the way!

milansimek commented 9 years ago

Actually this is a better fix, the directions click listener registers twice, it can be solved as follows:

Change:

if(_this.settings.inlineDirections === true){

To:

if(_this.settings.inlineDirections === true && typeof firstRun === "undefined"){
bjorn2404 commented 9 years ago

Thanks, I think I might go with the following since the origin has to exist for directions to work but either appear to fix the issue:

if(_this.settings.inlineDirections === true && typeof origin !== 'undefined'){
milansimek commented 9 years ago

Hi Bjorn,

Sounds good to me. Your version should make the code more solid for various cases.

Thanks!

bjorn2404 commented 9 years ago

Updated in v2.0.6.