Forum

Thread tagged as: Problem

Google Maps API Zoom

Cant get zoom to work properly.

<perch:content id="map" type="map" label="Address" width="100%" zoom="12" />

Get the same result with zoom="12" as with zoom="5". Doesnt get affected by zoom value i set. Everything else works just fine.

Erick Green

Erick Green 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

width needs to be a pixel dimension, else it won't work. e.g.

width="800"

I got the responsive map, so i actually dont need the width part. Any idea why it wont get the zoom right? Get the same zoom results, doesnt get affected by the number i type in.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's the default zoom when the map loads - if you re-zoom in the editor, the new zoom level will be used.

Is there a way to change the default zoom when the map loads? I got a local address typed in and it shows me cities around it as well. Need it to be zoomed closer to the address.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, the zoom attribute does that. That's all it does. It sets the default.

If you want to change the zoom level for a particular address, zoom the map and save.

Thats what i thought. Still cant see any difference in zoom tho. Doesnt matter if i set zoom="5" or zoom="12".

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does zooming the map make a change?

Yes. By scrolling or clicking +/- i can zoom in or out.

Drew McLellan

Drew McLellan 2638 points
Perch Support

And saving the content sets the zoom level?

Aaa... Thought you ment zooming the map front-end. Now i get it. Thanks!