Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update map width #195

Closed
kamov opened this issue Sep 19, 2017 · 7 comments
Closed

Update map width #195

kamov opened this issue Sep 19, 2017 · 7 comments

Comments

@kamov
Copy link

kamov commented Sep 19, 2017

I am using jquery to show/hide the panel with all locations.
I need to resize the map when panel close or open.

This is the code:

google.maps.event.trigger(map, "resize");

But how to get "map" object from Store Locator?

Thanks

@bjorn2404
Copy link
Owner

Use one of the callbacks that has the map object such as callbackMapSet:

https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/master/callbacks.md

@kamov
Copy link
Author

kamov commented Sep 20, 2017

mmm... yeah this work great...

I had already checked the callbacks, but for callbackMapSet for example is written
"Fires after the map has been loaded."

This mean that it's fire only 1 time after the map has been loaded?

Thank you!

@kamov kamov closed this as completed Sep 20, 2017
@kamov
Copy link
Author

kamov commented Sep 20, 2017

No, is not working always. I mean when you click on inline Directions, and then close directions, the map is not anymore resized

@kamov kamov reopened this Sep 20, 2017
@kamov
Copy link
Author

kamov commented Sep 20, 2017

I make this work by changing closeDirections callbacks.

// Line 1482 - added map param
closeDirections: function(map) {
...
			// Close directions callback
			if (this.settings.callbackCloseDirections) {
				this.settings.callbackCloseDirections.call(this, map);
			}
...
}

// Line 2219 - added map param in closeDirections()

		inlineDirections: function(map, origin) {
...
				// Close directions
				$(document).on('click.'+pluginName, '.' + _this.settings.locationList + ' .bh-sl-close-icon', function () {
					_this.closeDirections(map); // Added map here
				});
			});
		},

And then I can use callback like:

            callbackCloseDirections: function(map) {
                google.maps.event.trigger(map, "resize");
            },

Maybe there is another way?

@kamov
Copy link
Author

kamov commented Sep 20, 2017

No, is not working :(

I hope you have an idea, here is online: www.tinyURL.com/y8sz8va8

You can see that toggle of left panel work fine, until you close inline directions.
Then stop work.

Thanks

@kamov
Copy link
Author

kamov commented Sep 21, 2017

@bjorn2404 did you get my email about custom work?

@neshaman
Copy link

neshaman commented Oct 20, 2017

Hello bjorn,

I love you plugins. Super nice work man.

I'm struggling getting the customized map marker on the map.

I couldn't get how to for example change color on the map "pin" for specific item from the list?
I would like to have blue or red pins for different items from the list.

Is something like this built in the plugin, or I need to look into some custom work?

This is critical piece in me trying to use your plugin, so any feedback would be much appreciated.

Thank you very much,

Nenad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants