magikcypress / grav-plugin-leaflet Goto Github PK
View Code? Open in Web Editor NEWGrav Leaflet Plugin
License: MIT License
Grav Leaflet Plugin
License: MIT License
Is there a way to disable scroll with the plugin.
For instance, I'd like to do something like described here: https://gis.stackexchange.com/questions/200189/cant-continue-scrolling-on-mobile-devices-when-a-map-occupy-all-the-screen
The aim is to prevent page scrolls resulting in map zooming
I tried adding a variable in the leaflet.php
and map options but it doesn't have any effect:
...
$this->template_vars = [
'id' => $this->config->get('id') . '-' . self::$instances,
'width' => $this->config->get('width'),
'height' => $this->config->get('height'),
'class' => $this->config->get('class'),
'lat' => $this->config->get('lat'),
'lng' => $this->config->get('lng'),
'lat_marker' => $this->config->get('lat_marker'),
'lng_marker' => $this->config->get('lng_marker'),
'zoom' => $this->config->get('zoom'),
'address' => $this->config->get('address'),
/* added dragging variable */
'dragging' => $this->config->get('dragging'),
'scrollWheelZoom' => $this->config->get('scrollWheelZoom'),
'instances' => self::$instances
];
...
{{ leaflet({'class': 'map', 'width': '100%', 'height': '400', 'lat': '-33.05', 'lng': '150.8', 'lat_marker': '-33.6', 'lng_marker': '150.8', 'address': 'location', 'dragging': 'false', 'scrollWheelZoom': 'false'}) }}
I have leaflet in my template and show a map with every page in a collection of blog items. This means that the map should be shown multiple times.
However, only the first item in the collection show a map, all next ones don't.
Looking under the hood, the second item only has the outer container div and nothing more.
//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css
//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js
works fine
Dont you want to release the new version?
The map is not rendered under https, as long as the css and js URL is cdn.leafletjs.com
and not cdnjs.cloudflare.com
.
Please release, it is a critical bug!
The French language uses “,” as the decimal separator. As a consequence, when I write this:
leaflet:
lat: 47.22536
lng: -1.52307
lat_marker: 47.22536
lng_marker: -1.52307
numbers are read, and given to Javascript as 47,22536 and -1,52307 ⇒ This fails.
To make “leaflet” work, I had to change to this:
leaflet:
lat: '47.22536'
lng: '-1.52307'
lat_marker: '47.22536'
lng_marker: '-1.52307'
(strings instead of numbers)
Please either change all the examples accordingly (using strings), or keep numbers but force the locale to en_US
or the like while inserting these numbers into the Javascript.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.