diff options
Diffstat (limited to 'www/wiki/extensions/Maps/resources/leaflet/ext.sm.leafletajax.js')
-rw-r--r-- | www/wiki/extensions/Maps/resources/leaflet/ext.sm.leafletajax.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/www/wiki/extensions/Maps/resources/leaflet/ext.sm.leafletajax.js b/www/wiki/extensions/Maps/resources/leaflet/ext.sm.leafletajax.js deleted file mode 100644 index fb9f7341..00000000 --- a/www/wiki/extensions/Maps/resources/leaflet/ext.sm.leafletajax.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * JavaScript for Leaflet in the Semantic Maps extension. - * @see https://www.mediawiki.org/wiki/Extension:Semantic_Maps - * - * @licence GNU GPL v2+ - * @author Peter Grassberger < petertheone@gmail.com > - */ - - -(function( $, sm ) { - var ajaxRequest = null; - - var mapEvents = ['dragend', 'zoomend']; - - $( document ).ready( function() { - // todo: find a way to remove setTimeout. - setTimeout( function() { - $( window.maps.leafletList ).each( function( index, map ) { - if( !map.options.ajaxquery || !map.options.ajaxcoordproperty ) { - return; - } - map.map.on( mapEvents.join( ' ' ), function() { - var bounds = map.map.getBounds(); - var query = sm.buildQueryString( - decodeURIComponent( map.options.ajaxquery.replace( /\+/g, ' ' ) ), - map.options.ajaxcoordproperty, - bounds.getNorthEast().lat, - bounds.getNorthEast().lng, - bounds.getSouthWest().lat, - bounds.getSouthWest().lng - ); - - if( ajaxRequest !== null ) { - ajaxRequest.abort(); - } - ajaxRequest = sm.ajaxUpdateMarker( map, query, map.options.icon ).done( function() { - map.createMarkerCluster(); - ajaxRequest = null; - } ); - } ); - } ); - }, 1000 ); - } ); -})( window.jQuery, window.sm ); |