Close

Control Zoom on the AllShops page

JRon
9 years ago
#8823 Quote
Avatar
  • 67
Is it not possible to edit the zoom level of the map on the AllShop page?
How would I do that, I tried changing the zoom level set in the javascript file (StoreLocatorAllShops.min) but that didn´t change anything.
Deni
9 years ago
#8827 Quote
Avatar
  • Moderator
  • 389
Rönning wrote:
Is it not possible to edit the zoom level of the map on the AllShop page?
How would I do that, I tried changing the zoom level set in the javascript file (StoreLocatorAllShops.min) but that didn´t change anything.


Hi, if you are talking about the All Shops page, then you have to go to this file: \Plugins\SevenSpikes.Nop.Plugins.StoreLocator\Scripts\StoreLocatorAllShops.min.js and find this: "zoom: 15". Edit it per your taste (maybe 11-12 will be OK).
Best Regards,
Mladen Staykov
Nop-Templates.com
JRon
9 years ago
#8831 Quote
Avatar
  • 67
I tried changing that setting but nothing changed, I also tried restarting my site after chnging the value from 15 to 12 but nothing changed

Any ideas why it´s not responding to the setting, I have 6 shops marked on my map if that matters
JRon
9 years ago
#8847 Quote
Avatar
  • 67
Nothing? It´s supposed to work like that: I would change the zoom level in  \Plugins\SevenSpikes.Nop.Plugins.StoreLocator\Scripts\StoreLocatorAllShops.min.js from 15 to a lover level to zoom out, higher level to zoom in.

Is it a bug in my plugin (got the latest version from the mega plugin pack) or is there something wrong on my end?
Deni
9 years ago
#8849 Quote
Avatar
  • Moderator
  • 389
Hi, 

This setting was left for cases when you have only one store. But since you have 6, then this setting is not used. The Google map is clever enough to take all the six shop markers and zoom the map to fit all them in. And that is why you do not need zoom level.
Best Regards,
Mladen Staykov
Nop-Templates.com
JRon
9 years ago
#8852 Quote
Avatar
  • 67
OK, I have been reading about this and Google changed something in V3 that took away the zooming options if using more than one marker

I have seen that people are setting an option called preserveViewport of ctaLayer to true and that makes the zoom setting work again, I could try that out but my javascript coding skill is very limited
illutian
9 years ago
#9653 Quote
Avatar
  • 18
I see another had this issue.

---

I have one shop and the Google Map is pretty useless because it's defaulted to zoom right up on the building and if you're, well, a typical Internet User. You won't know to zoom out.

I've changed the 'zoom' in both the AllShop and Shop JS scripts to 50 with zero affect.

It's completely beyond me as to why the Admin JS is set to 'zoom' 15 and correctly displays a slightly zoomed in map, which clearly shows the intersection,, road names, and surrounding businesses. Why can't I have THAT map? :(
Deni
9 years ago
#9657 Quote
Avatar
  • Moderator
  • 389
illutian wrote:
I see another had this issue.

---

I have one shop and the Google Map is pretty useless because it's defaulted to zoom right up on the building and if you're, well, a typical Internet User. You won't know to zoom out.

I've changed the 'zoom' in both the AllShop and Shop JS scripts to 50 with zero affect.

It's completely beyond me as to why the Admin JS is set to 'zoom' 15 and correctly displays a slightly zoomed in map, which clearly shows the intersection,, road names, and surrounding businesses. Why can't I have THAT map? :(


Hi, 

After taking into consideration your case, we found that when there is only one shop, the Google Maps "fitBounds" method should not be used, because it causes the zoom issue. We will fix this ASAP.

If you want to fix it on your own, just go to the StoreLocatorAllShops.min.js file,
search for: 
"addMarker(allShops[e], !1); map.fitBounds(bounds)"

and replace it with this:
"addMarker(allShops[e], !1); allShops.length > 1 && map.fitBounds(bounds)".

Thank you for reporting this !
Best Regards,
Mladen Staykov
Nop-Templates.com
illutian
9 years ago
#9658 Quote
Avatar
  • 18
Deni wrote:
I see another had this issue.

---

I have one shop and the Google Map is pretty useless because it's defaulted to zoom right up on the building and if you're, well, a typical Internet User. You won't know to zoom out.

I've changed the 'zoom' in both the AllShop and Shop JS scripts to 50 with zero affect.

It's completely beyond me as to why the Admin JS is set to 'zoom' 15 and correctly displays a slightly zoomed in map, which clearly shows the intersection,, road names, and surrounding businesses. Why can't I have THAT map? :(

Hi, 

After taking into consideration your case, we found that when there is only one shop, the Google Maps "fitBounds" method should not be used, because it causes the zoom issue. We will fix this ASAP.

If you want to fix it on your own, just go to the StoreLocatorAllShops.min.js file,
search for: 
"addMarker(allShops[e], !1); map.fitBounds(bounds)"

and replace it with this:
"addMarker(allShops[e], !1); allShops.length > 1 && map.fitBounds(bounds)".

Thank you for reporting this !


Um, I don't 'StoreLocatorAllShops.min.js', only StoreLocatorAllShops.JS

((Running Store Locator 'trial' for Nop 3.5, sorry forgot to mention that))

This is the only place where 'map.fitBounds' shows up:

function onMapLoad() {
    bounds = new google.maps.LatLngBounds();
    
    for (var a = 0; a < allShops.length; a++) {
        addMarker(allShops[a], false);
    }

    map.fitBounds(bounds);
}
Deni
9 years ago
#9663 Quote
Avatar
  • Moderator
  • 389
Hi, 

I am talking about the latest version of the plugin for v3.60. We have just deployed the fix, so please update the plugin and everything will work fine.
Best Regards,
Mladen Staykov
Nop-Templates.com