2amigos / yii2-leaflet-extension

Yii 2 Extension library to display interactive maps with Leaflet .
http://yiiwheels.com
Other
30 stars 26 forks source link

Problem positioning the zoom control #24

Closed bqtran closed 8 years ago

bqtran commented 8 years ago

By default, the zoom control is in the top left hand corner. How do you position it to a different corner? I've tried doing this, but it doesn't seem to take effect:

$zoomCtl = new Zoom(); $zoomCtl->position = 'bottomright'; $leaflet->setControls([$zoomCtl]);

Can you point me in the right direction?

Thanks.

bqtran commented 8 years ago

Correction. It does show up in the bottom right corner, but now I have the original zoom control in the top left corner as well. I noticed in Zoom.php:12-13, there's a note to set the map's zoomControl option to false. How do I go about removing the default one?

Thanks.

bqtran commented 8 years ago

After some digging, I found the solution: $leaflet->clientOptions['zoomControl'] = false;