Disable scroll wheel zoom with Openstreetmap

Phoca Maps - displaying maps in Joomla! CMS
arkham21
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 22 Dec 2018, 13:44

Disable scroll wheel zoom with Openstreetmap

Post by arkham21 »

Hello,

Can you tell me how disable scrool wheel zoom with Openstreetmap ?

The option in the advanced setting seems work only with Google Maps.

Thanks for your help,

Arkham
christine
Phoca Hero
Phoca Hero
Posts: 2734
Joined: 28 Nov 2010, 17:20

Re: Disable scroll wheel zoom with Openstreetmap

Post by christine »

Hi Arkham,

do you mean the + - ? Then try to add to your template.css:

Code: Select all

.leaflet-bar {
display: none;
}
or:

Code: Select all

.leaflet-control-zoom-in, .leaflet-control-zoom-out {
display: none !important;
}
Kind regards
Christine
arkham21
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 22 Dec 2018, 13:44

Re: Disable scroll wheel zoom with Openstreetmap

Post by arkham21 »

Hi Christine,

No, I want to disable the zoom with the wheel of the mouse when the mouse is on the map.
christine
Phoca Hero
Phoca Hero
Posts: 2734
Joined: 28 Nov 2010, 17:20

Re: Disable scroll wheel zoom with Openstreetmap

Post by christine »

Hi Arkham,

OK. I found this: https://www.mapbox.com/mapbox-gl-js/exa ... roll-zoom/ similar to this:
https://github.com/Leaflet/Leaflet/issues/2720

map.scrollWheelZoom.disable()

Above question, I will pass on to Jan.

Kind regards
Christine
arkham21
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 22 Dec 2018, 13:44

Re: Disable scroll wheel zoom with Openstreetmap

Post by arkham21 »

Hi Christine,

Thanks for your response.

This corresponds to what I'm looking for, but where do I need to insert the code ? I think it's when calling the creation of the map by Phoca Maps. Where did the call take place ? I'm looking some files but I can't find it...

Best regards,

Arkham
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Disable scroll wheel zoom with Openstreetmap

Post by Jan »

Hi, try to open this file:

administrator\components\com_phocamaps\helpers\phocamapsmaposm.php

line cca 250 and add before this code:

Code: Select all

$this->output[] = implode("\n", $o);
following code:

Code: Select all

$o[]= 'var map'.$this->name.$this->id.'.scrollZoom.disable();';
Jan
If you find Phoca extensions useful, please support the project
schwarzwaldbub
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Jan 2019, 18:26

Re: Disable scroll wheel zoom with Openstreetmap

Post by schwarzwaldbub »

You can do this directly in your backend (current version of PhocaMaps). When you choose Phoca Maps you have on the right side the button "options" (with the cog). Here your can go to "OpenStreetMap" and at the option "Enable Mouse Wheel Zoom" you can set "no".

Best regards
Stefan
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Disable scroll wheel zoom with Openstreetmap

Post by Jan »

Ok, great, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply