Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Fusiontable Map Template | 336 | 4 years ago | 8 | other | CSS | |||||
:earth_americas: Searchable Map Template using Google Maps and Fusion Tables | ||||||||||
Leaflet.fullscreen | 285 | 34 | 15 | a year ago | 21 | June 09, 2022 | 2 | mit | HTML | |
Leaflet.Control.FullScreen for Leaflet | ||||||||||
Leafletcn | 146 | 5 years ago | 9 | R | ||||||
An R gallery for China and other geojson choropleth map in leaflet | ||||||||||
Cleanmaps | 52 | 9 years ago | bsd-2-clause | JavaScript | ||||||
Cleaner Google Maps | ||||||||||
Fortnite Maps | 44 | 2 years ago | JavaScript | |||||||
🗺️ Calculate distance and estimated arrival with FortniteMaps | ||||||||||
Googlemaps Scrollprevent | 42 | 7 years ago | JavaScript | |||||||
:lock: googlemaps-scrollprevent avoid unwanted map interactions with the Google Maps Iframe. | ||||||||||
Opendataindex | 33 | 6 years ago | 33 | CSS | ||||||
Open Data Index website | ||||||||||
Hexo Tag Googlemaps | 17 | 17 | 2 | 4 years ago | 6 | July 02, 2017 | 2 | mit | HTML | |
A hexo tag for google maps. Does much more than a simple embedded iFrame | ||||||||||
Map_widget_maker | 15 | 10 years ago | 1 | mit | JavaScript | |||||
Create at embed-able map iFrame using WMS services and leaflet. | ||||||||||
Labs Cdbfiddle | 7 | 7 years ago | 1 | HTML | ||||||
An HTML template that takes a viz.json and displays the map, SQL, and CartoCSS in a neat embeddable iframe |
Avoid unwanted map interactions with the Google Maps Iframe.
Disable mouse scroll wheel zoom on embedded Google Maps
googlemaps-scrollprevent is an easy solution to the problem of page scrolling with new "Google Maps Iframe Embed".
This jQuery Mobile First plugin prevents Google Maps iframe from capturing the mouse's scrolling wheel / touch scrolling behavior wrapping the <iframe>
with a transparent <div>
on mouse / touch hover, so you must click / tap the unlock button to toggle the normal navigation. See the Live Demo.
This jQuery plugin is written with CoffeeScript that compiles in JavaScript, so the source files are a little different from standard JavaScript.
Please if you are using this plugin open an Issue with the tag showcase
. If this plugin was helpful for you saving some time and effort. Can consider donate as a thank you. Thanks!
You can find simpler approaches in stackoverflow like:
For usage examples check the live demo.
Include jQuery and googlemaps-scrollprevent Libs in your html.
<!-- html -->
<head>
// jQuery Google CDN
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js?ver=2.1.4"></script>
// googlemaps-scrollprevent rawgit CDN
<script type="text/javascript" src="https://cdn.rawgit.com/diazemiliano/googlemaps-scrollprevent/master/dist/googlemaps-scrollprevent.min.js"></script>
</head>
Start mapScrollPrevent including the following code.
<!-- html -->
<script type="text/javascript">
$(function() {
// Only Google Maps Selector
var googleMapSelector = "iframe[src*=\"google.com/maps\"]";
$(googleMapSelector).scrollprevent().start();
});
</script>
Or Stop with:
// JavaScript
// Stop
$(googleMapSelector).scrollprevent().stop();
Edit defaults.
<!-- html -->
<script type="text/javascript">
$(function() {
// Only Google Maps Selector
var googleMapSelector = "iframe[src*=\"google.com/maps\"]";
var options = { pressDuration: 1000 };
$(googleMapSelector).scrollprevent(options).start();
});
</script>
With Callbacks
// JavaScript
$(function(){
$("#btn-start").click(function(){
$("iframe[src*='google.com/maps']").scrollprevent({
onMapLock: function() {
// Your code here.
alert("Map Locked")
},
onMapUnlock: function() {
// Your code here.
alert("Map Unlocked")
}
}).start();
});
});
functions.php
```php
// PHP
// First Enqueue the plugin
function mapScrollPrevent_plugin() {
wp_enqueue_script( 'mapScrollPrevent', 'https://cdn.rawgit.com/diazemiliano/mapScrollPrevent/master/dist/mapScrollPrevent.min.js', array( 'jquery' ) , '0.6.4', true );
}
// Second Enqueue the script
function mapScrollPrevent_script()
{
echo '
<script type="text/javascript">
$(function() {
var googleMapSelector = "iframe[src*=\"google.com/maps\"]";
var options = { pressDuration: 1000 };
$(googleMapSelector).scrollprevent(options).start();
});
</script>
';
}
// Do the hook
add_action( 'wp_enqueue_scripts', 'mapScrollPrevent_plugin' );
add_action( 'wp_head', 'mapScrollPrevent_script' );
```
// JavaScript
var options = {
"class": {
/* class for map wrap */
wrap: "mapscroll-wrap",
/* class for hover div */
overlay: "mapscroll-overlay",
/* class for progress bar */
progress: "mapscroll-progress",
/* class for the unlock button */
button: "mapscroll-button",
/* class for svg icons */
icon: "mapscroll-icon"
},
/* Press Duration */
pressDuration: 650,
/* Unlock Trigger (overlay|button) */
triggerElm: "button",
/* Buton Icons */
overlay: {
iconLocked: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 1792 1792\" > <path transform=\"translate(1)\" d=\"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z\" /> </svg>",
iconUnloking: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 1792 1792\"> <path transform=\"translate(1)\" d=\"M1376 768q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-320q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45q0-106-75-181t-181-75-181 75-75 181v320h736z\" /> </svg>",
iconUnlocked: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 1792 1792\"> <path transform=\"translate(1)\" d=\"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z\" /> </svg>"
},
/* Callbaks */
onMapLock: function() {},
onMapUnlock: function() {},
/* Print Log Messges */
printLog: false
};
To build from source you can use the packaje.json
file to install all "dev dependencies". We use Gulp and some node-modules
.
git
client.node.js
.npm install gulp -g
.npm update --save-dev
in your terminal.googlemaps-scrollprevent.coffee
source file.gulp coffee
or gulp watch
task in your terminal.googlemaps-scrollprevent.min.js
file in the ./dist/
folder.The MIT License (MIT)
Copyright (c) 2016 Emiliano Daz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.