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

Zoom always resetting to default #53

Closed
idawgik opened this issue Apr 20, 2022 · 7 comments
Closed

Zoom always resetting to default #53

idawgik opened this issue Apr 20, 2022 · 7 comments
Labels
Bug Report Something isn't working

Comments

@idawgik
Copy link

idawgik commented Apr 20, 2022

I am trying to add a map with a specific zoom level set in the template (using the twig code). However, no matter how I set the zoom, it's always reset and loaded at the default value of 11.

Doing a bit of tracing through the dynamicmap.js file and adding some console logs to output, it initially applies the zoom I have set, but then resets it to the default. The reset is happening in the this._preventGreyBox function. For some reason, that function isn't able to get the zoom value I have set.

Here is my template code:

{% set address = contactInformation.location %}
{{ googleMaps.map(address, {
    'height': 500
}).zoom(17).tag() }}

I also tried it with the zoom as part of the options with no different result:

{% set address = contactInformation.location %}
{{ googleMaps.map(address, {
    'height': 500,
    'zoom': 17
}).tag() }}

I'm very likely missing something obvious, but it's definitely not working for me.

I am on Craft CMS 3.7.38 and Google Maps 4.1.9.

@lindseydiloreto
Copy link
Collaborator

Hi @idawgik,

Sorry about that, I think I know where the problem is! I can get it patched up, though it might take a few weeks because of my upcoming schedule.

In the meantime, simply roll the Google Maps plugin back to an earlier version. I'm not sure how far back you need to go, maybe only one or two releases back. At worst, you can lock the plugin version to 4.1.4, which was a very stable version (before I made some changes to the info windows).

Depending on circumstance, the patch might only get applied to a version of the plugin which is compatible with Craft 4.

What is your estimated timeline for updating to Craft 4?

@lindseydiloreto lindseydiloreto added the Bug Report Something isn't working label Apr 20, 2022
@idawgik
Copy link
Author

idawgik commented Apr 22, 2022

I downgraded to 4.1.4 and it's working great.

This is a site still early in development, so we will probably be moving it to Craft 4 right away when that's released.

@lindseydiloreto
Copy link
Collaborator

Excellent, thanks for reporting back!

@idawgik
Copy link
Author

idawgik commented May 5, 2022

As an FYI, I updated this dev site up to Craft 4 yesterday, and this issue came back with the plugin version compatible with Craft 4. This is on Google Maps v4.2.1

@lindseydiloreto
Copy link
Collaborator

This is now fixed! Update to v4.2.2 whenever you get a chance.

@idawgik
Copy link
Author

idawgik commented May 10, 2022

Just updated. Works great. Thank you!

@lindseydiloreto
Copy link
Collaborator

Awesome, thanks for reporting back! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants