From 32096edf61bf07c257f750e0fddd3598fdd6789b Mon Sep 17 00:00:00 2001 From: lsces Date: Mon, 4 Aug 2014 23:59:39 +0100 Subject: Upgrade to CKEditor 4.4.3 New plugin for map handling via leaflet --- .../leaflet/Creating and Editing Leaflet Maps.txt | 56 ++ plugins/leaflet/Installation Guide.txt | 203 ++++++ plugins/leaflet/README.md | 65 ++ plugins/leaflet/css/contents.css | 25 + plugins/leaflet/dialogs/leaflet.js | 9 + .../leaflet/scripts/Leaflet-MiniMap/LICENSE.txt | 22 + .../scripts/Leaflet-MiniMap/example/example.html | 37 + .../example/example_customRects.html | 40 ++ .../Leaflet-MiniMap/example/example_fixedzoom.html | 37 + .../Leaflet-MiniMap/example/example_larger.html | 40 ++ .../example/example_layergroup.html | 61 ++ .../Leaflet-MiniMap/example/example_lowzoom.html | 37 + .../example/example_toggleDisplay.html | 37 + .../scripts/Leaflet-MiniMap/example/fullscreen.css | 7 + .../example/local_pubs_restaurant_norway.js | 777 +++++++++++++++++++++ .../leaflet/scripts/Leaflet-MiniMap/package.json | 25 + plugins/leaflet/scripts/Leaflet-MiniMap/readme.md | 47 ++ .../Leaflet-MiniMap/src/Control.MiniMap-de.js | 1 + .../Leaflet-MiniMap/src/Control.MiniMap.css | 43 ++ .../scripts/Leaflet-MiniMap/src/Control.MiniMap.js | 12 + .../scripts/Leaflet-MiniMap/src/images/toggle.png | Bin 0 -> 345 bytes .../scripts/leaflet-providers/.jshintignore | 1 + .../leaflet/scripts/leaflet-providers/.jshintrc | 40 ++ .../scripts/leaflet-providers/CONTRIBUTING.md | 10 + .../leaflet/scripts/leaflet-providers/README.md | 75 ++ .../leaflet/scripts/leaflet-providers/bower.json | 22 + .../leaflet-providers/css/gh-fork-ribbon.css | 127 ++++ .../leaflet-providers/css/gh-fork-ribbon.ie.css | 68 ++ .../leaflet/scripts/leaflet-providers/index.html | 153 ++++ .../scripts/leaflet-providers/leaflet-providers.js | 20 + .../leaflet/scripts/leaflet-providers/license.md | 9 + .../leaflet/scripts/leaflet-providers/package.json | 20 + .../preview/L.Control.Layers.Minimap.js | 7 + .../leaflet-providers/preview/L.Map.Sync.js | 3 + .../preview/control.layers.minimap.css | 35 + .../leaflet-providers/preview/highlightjs/LICENSE | 24 + .../preview/highlightjs/github.css | 127 ++++ .../preview/highlightjs/highlight.pack.js | 14 + .../scripts/leaflet-providers/preview/index.html | 90 +++ .../scripts/leaflet-providers/preview/preview.js | 4 + plugins/leaflet/scripts/mapParser.html | 113 +++ 41 files changed, 2543 insertions(+) create mode 100644 plugins/leaflet/Creating and Editing Leaflet Maps.txt create mode 100644 plugins/leaflet/Installation Guide.txt create mode 100644 plugins/leaflet/README.md create mode 100644 plugins/leaflet/css/contents.css create mode 100644 plugins/leaflet/dialogs/leaflet.js create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/LICENSE.txt create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example_customRects.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example_fixedzoom.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example_larger.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example_layergroup.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example_lowzoom.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/example_toggleDisplay.html create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/fullscreen.css create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/example/local_pubs_restaurant_norway.js create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/package.json create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/readme.md create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/src/Control.MiniMap-de.js create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/src/Control.MiniMap.css create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/src/Control.MiniMap.js create mode 100644 plugins/leaflet/scripts/Leaflet-MiniMap/src/images/toggle.png create mode 100644 plugins/leaflet/scripts/leaflet-providers/.jshintignore create mode 100644 plugins/leaflet/scripts/leaflet-providers/.jshintrc create mode 100644 plugins/leaflet/scripts/leaflet-providers/CONTRIBUTING.md create mode 100644 plugins/leaflet/scripts/leaflet-providers/README.md create mode 100644 plugins/leaflet/scripts/leaflet-providers/bower.json create mode 100644 plugins/leaflet/scripts/leaflet-providers/css/gh-fork-ribbon.css create mode 100644 plugins/leaflet/scripts/leaflet-providers/css/gh-fork-ribbon.ie.css create mode 100644 plugins/leaflet/scripts/leaflet-providers/index.html create mode 100644 plugins/leaflet/scripts/leaflet-providers/leaflet-providers.js create mode 100644 plugins/leaflet/scripts/leaflet-providers/license.md create mode 100644 plugins/leaflet/scripts/leaflet-providers/package.json create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/L.Control.Layers.Minimap.js create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/control.layers.minimap.css create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/LICENSE create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/github.css create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/highlight.pack.js create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/index.html create mode 100644 plugins/leaflet/scripts/leaflet-providers/preview/preview.js create mode 100644 plugins/leaflet/scripts/mapParser.html diff --git a/plugins/leaflet/Creating and Editing Leaflet Maps.txt b/plugins/leaflet/Creating and Editing Leaflet Maps.txt new file mode 100644 index 0000000..50f9ffa --- /dev/null +++ b/plugins/leaflet/Creating and Editing Leaflet Maps.txt @@ -0,0 +1,56 @@ +CKEditor Leaflet Map Plugin + + +I. CREATING NEW MAP + +1.) Click the Leaflet Map icon in the CKEditor Toolbar. The Dialog window will now pop-up. + +Then, it is EITHER of the 2 steps: +2) Input the Place name (for example: Manila, Philippines). + +3.) Input the Latitude and Longitude values of a Place in their corresponding text fields. +(for example: Latitude = 14.123456 and Longitude = 121.654321) + +Then click the OK button. After that, a map will be created, centered on that specified coordinates, with the following default values: +Width: 400px +Height: 400px +Zoom Level: 10 +Map Tile: MapQuestOpen.OSM +Overview Map (MiniMap): Enabled +Alignment: Left + +Note that if you do BOTH #2 and #3 (which is I think will rarely happen), the value in #2 will be ignored and the values/coordinates in #3 will be used. + + +II. EDITING EXISTING MAP + +It is either of the 2 steps: + +1.) If you hover the mouse on the map, you will see the map's handle bar (cross hair) in the UPPER LEFT corner of the map, +you could then double-click that to view or edit the map properties. + +2.) With your mouse, select the map to be edited (to set the focus away from other CKEditor objects). Then click the Leaflet Map icon in the CKEditor toolbar. + +The Dialog will pop-up and will be set to the properties of the currently selected map. +Note that the #1 is the preferred way. + +To set the current map in a NEW location, either specify a new Place name value in the Search field, or specify a new Lat/Lon values in the corresponding text fields. Note that if you change BOTH the values in the Search field and the Lat/Lon fields (which is I think will rarely happen), the values in the Lat/Lon fields will be used. + +You might be wondering why the #1 step has to be done that way. +The main reason is that CKEditor Leaflet Maps uses the Widget API (introduced in CKEditor 4.3). +The Widget API introduces innovative features and more plugin flexibility. + +For one, the map could have a Map Mode and Widget Mode. +Map mode uses the mouse wheel or double-click for zooming the map, +Left-Click+Hold+Drag for panning the map, +and the possibility to use the map's '+/-' zoom UI buttons. + +We could have opted to bind the double-click for showing the map's option +at the expense of lesser map interaction. However, since I believe that map interaction +is relatively more important compared to widget's interaction, we need to compromise a bit. +That's why in order to edit the map's options, we have to do a mouse hover onto the map +and double-click the default widget's handle bars in the map's upper left corner +so that the default map's behavior and mouse and key bindings could still be preserved. + +Later, we might include the option to edit the map widget's option +using the Right-Click or Ctrl+Left-Click event bindings. diff --git a/plugins/leaflet/Installation Guide.txt b/plugins/leaflet/Installation Guide.txt new file mode 100644 index 0000000..f115321 --- /dev/null +++ b/plugins/leaflet/Installation Guide.txt @@ -0,0 +1,203 @@ +I. OVERVIEW + +This Leaflet Maps plugin requires CKEditor 4.3 or later versions, and it leverages the power and flexibility +of Widget API. Hence, the 'widget' plugin is also a hard dependency (which also depends on Line Utilities +and Clipboard plugins). The Clipboard plugin is already loaded by default in all presets/pre-built packages of CKEditor +(Basic, Standard, and Full). Hence, we only need to download the Widget plugin (http://ckeditor.com/addon/widget), +the Line Utilities plugin (http://ckeditor.com/addon/lineutils), and this Leaflet Maps plugin (http://ckeditor.com/addon/leaflet). + +For Linux users, after downloading, make sure that the zipped folders or the target CKEditor folders + have right read/write/execute permissions, otherwise you might encounter loading issues + like the "File x could not be found" notice. You might need to run "sudo chmod 777 -R leaflet", + "sudo chmod 777 -R lineutils", and "sudo chmod 777 -R widget" before or after copying them + in the appropriate CKEditor folders. + + +II. STANDARD INSTALLATION (Usual Setup) + +1) After unzipping the folder, paste the three folders ("lineutils", "leaflet", and "widget") + to "ckeditor/plugins" folder. After that, you should have the following folder structures: + "ckeditor/plugins/leaflet" + "ckeditor/plugins/lineutils" + "ckeditor/plugins/widget" + +2) Edit the "ckeditor/config.js" file, and add the following: + if there's no existing line yet: + config.extraPlugins = "lineutils,widget,leaflet"; + + otherwise, append it to the existing list, no extra spaces are allowed: + config.extraPlugins = "existing_plugin,another_existing_plugin,lineutils,widget,leaflet"; + +3.) Just to make sure, clear the web browser's cache after modifying your configuration. + Clearing the browser's cache is also very important + since the CKEditor's JS and CSS assets/components are cached also in the browser. + + +III. DRUPAL INSTALLATION + +In Drupal, the typical way to embed the CKEditor WSYIWYG is +through the CKEditor module (https://drupal.org/project/ckeditor), +and then loading the corresponding CKEditor JS library (http://ckeditor.com/). + +Drupal's CKEditor module (tested on version ) is typically installed to have this internal path: + sites/all/modules/ckeditor or sites/all/modules/contrib/ckeditor. + +Note that this guide is tested on CKEditor "7.x-1.13", latest version is "7.x-1.14". +I'll test this guide also in the latest version later. + +Moreover, the CKeditor JS Library is typically installed to have this internal path: + "sites/all/modules/ckeditor/ckeditor/ckeditor.js" or + "sites/all/modules/contrib/ckeditor/ckeditor/ckeditor.js" or + "sites/all/libraries/ckeditor/ckeditor.js." + +However, installing additional plugins in CKEditor in Drupal is not that straightforward +as we could see from the issue queues: + https://drupal.org/node/2215409#comment-8568207 + https://drupal.org/node/1930130#comment-7297628 + https://drupal.org/node/1324554 + https://drupal.org/node/2215497 + +Nevertheless, after experimenting with the various ways to enable the additional plugins +(Line Utilities, Widget, and Leaflet), this is the simplest solution +(the idea is to copy the plugin folders, enable them, and make them visible in the toolbar): + + +A. DRUPAL INSTALLATION OPTION 1 + + 1.) Download and unzip the plugins here (depending on your setup): + "sites/all/modules/ckeditor/plugins" or + "sites/all/modules/contrib/ckeditor/plugins". + + After that, you should have the following folder structures: + "ckeditor/plugins/leaflet" + "ckeditor/plugins/lineutils" + "ckeditor/plugins/widget" + + 2.) We should now activate the new plugins and add them to the toolbar. + This is done by configuring the CKEditor Profile Settings, + in which by default is located in: + "admin/config/content/ckeditor/edit/Advanced" + + A. Activate the Plugins + In EDITOR APPEARANCE >>> Plugins section: + Enable the corresponding checkboxes for the Leaflet Maps, Line Utilities, + and Widget plugins. These are the texts displayed adjacent to their checkboxes: + "Plugin file: leaflet" + "Plugin file: lineutils" + "Plugin file: widget" + + B. Add them to the Toolbar + We should then make the activated plugins visible in the toolbar, + skipping this step will make the Leaflet Maps plugin inaccessible in the toolbar. + + In EDITOR APPEARANCE >>> Toolbar section: + Drag the Leaflet Maps icon (black-colored) from the 'All Buttons' section + to the 'Used Buttons' section. + + We need to configure the Leaflet Maps icon only since the Line Utilities and Widget plugins + have no toolbar icons and they will just load in the background. + + 3.) Then, click the Save button. Clear the Drupal's overall cache AND + clear the browser's cache. Clearing the browser's cache is also + very important since the CKEditor's JS and CSS assets/components + are cached also in the browser. + + As indicated above, using the "sites/all/modules/ckeditor/plugins" or + "sites/all/modules/contrib/ckeditor/plugins" + will work with no additional custom hooks programming since by default + CKEditor utilize that folder in the CKEditor Global Profile Settings: + "admin/config/content/ckeditor/editg". + + If you go that Global Profile Settings page, this will be indicated + (unless you override the default configuration): + Path to the CKEditor plugins directory: "%m/plugins" + + In which "%m" refers to the base URL path where the CKEditor module is stored, + and defaults to "sites/all/modules/ckeditor" or "sites/all/modules/contrib/ckeditor". + + +B. DRUPAL INSTALLATION OPTION 2 + + With the advent of Libraries API (https://drupal.org/project/libraries), + Drupal offers more flexibility in the handling of external/third-party libraries, + which means a clean mechanism that provides a separation of control between + the CKEditor module and CKEditor library, and implies that we could + safely upgrade the library and module independent to each other. + Having a Libraries folder (sites/all/libraries) is also a very common setup in Drupal. + + This setup assumes that you've already installed and enabled the Libraries API module + and configured the CKEditor library (sites/all/libraries/ckeditor). + Make sure also that the "Path to CKEditor" settings indicated in + the CKEditor's Global Profile (admin/config/content/ckeditor/editg) is + indicated as "%l/ckeditor", in which "%l" refers to the "sites/all/libraries". + + 1.) Download and unzip the plugins here: + "sites/all/libraries/ckeditor/plugins" + + After that, you should have the following folder structures: + "ckeditor/plugins/leaflet" + "ckeditor/plugins/lineutils" + "ckeditor/plugins/widget" + + 2.) We should now activate the new plugins and add them to the toolbar. + This is done by implementing first the hook_ckeditor_plugin() in a custom module: + + function MYMODULE_ckeditor_plugin() { + return array( + 'leaflet' => array( + 'name' => 'Leaflet Maps', + 'desc' => t('Plugin for inserting Leaflet Maps.'), + 'path' => libraries_get_path('ckeditor') . '/plugins/leaflet/', + 'buttons' => array( + 'leaflet' => array( + 'label' => 'Leaflet Maps', + 'icon' => 'icons/leaflet.png', + ), + ), + ), + ); + } + + For convenience, I've created a Drupal utility module specifically for this purpose, + check-out the module and instructions here: + https://github.com/ranelpadon/drupal-leaflet-maps/tree/master + + Fortunately, we need only to register the Leaflet Maps plugin, + the Line Utilities and Widget plugins are automatically registered. + The Leaflet Maps Drupal module above is enough for our purpose. + + Now, we configure the CKEditor Profile Settings, + in which by default is located in: + "admin/config/content/ckeditor/edit/Advanced" + + A. Activate the Plugin + In EDITOR APPEARANCE >>> Plugins section: + Enable the corresponding checkbox for the Leaflet Maps plugin. + This is the description displayed adjacent to its checkbox: + "Plugin for inserting Leaflet Maps." + + B. Add them to the Toolbar + We should then make the activated plugin visible in the toolbar, + skipping this step will make the Leaflet Maps plugin inaccessible in the toolbar. + + In EDITOR APPEARANCE >>> Toolbar section: + Drag the Leaflet Maps icon (black-colored) from the 'All Buttons' section + to the 'Used Buttons' section. + + We need to configure the Leaflet Maps icon only since + the Line Utilities and Widget plugins have no toolbar icons and + they will just load in the background. + + 3.) Then, click the Save button. Clear the Drupal's overall cache AND + clear the browser's cache. Clearing the browser's cache is also + very important since the CKEditor's JS and CSS assets/components + are cached also in the browser. + +Note that if you configure the Leaflet Maps, Line Utilities, and Widget plugins +using the handy CKEditor auto-builder (http://ckeditor.com/builder) and +bundled it with the core "ckeditor.js" file, it will not work in Drupal, +since as far as I know, the Drupal's CKEditor module +(or specifically the hook_ckeditor_plugin()) has no support for it yet. + +But, outside of Drupal, the Leaflet Maps will work even when +pre-configured/auto-bundled using the CKEditor builder. diff --git a/plugins/leaflet/README.md b/plugins/leaflet/README.md new file mode 100644 index 0000000..7cda4f6 --- /dev/null +++ b/plugins/leaflet/README.md @@ -0,0 +1,65 @@ +ckeditor-leaflet +================ +OVERVIEW:
+This CKEditor Leaflet Maps plugin has three workhorse files: + + +This plugin utilizes the following technologies/libraries:
+ + +LIVE DEMO PAGE: +
Demo page could be found here: http://ranelpadon.github.io/ckeditor-leaflet/index.html + +INSTALLATION: +
Kindly refer to Installation Guide + +HOW TO USE: +
Kindly refer to How to Create and Edit Leaflet Maps + +ROAD MAP (Planned stuff to do):
+ +LICENSE and CREDITS:
+ +License: LGPL v3 applies.
+Copyright 2014 by Engr. Ranel O. Padon
+ranel.padon@gmail.com
+ +Plugin's icon is a property of simpleicon. +As indicated in their website, use of their icon is allowed as long as it includes proper credit and backlink. + +Thanks to CKEditor, Leaflet, and other great open-source softwares and their unsung developers.
+ +Special thanks also to the insights, guidance, and collaborative support of our CNN Travel team:
+Senior Web Development Manager:
+Brent A. Deverman
+ +Senior Software Engineer:
+Adrian Christopher B. Cruz
+ +Senior QA Analyst:
+Jonathan A. Jacinto
+ +======================================================= diff --git a/plugins/leaflet/css/contents.css b/plugins/leaflet/css/contents.css new file mode 100644 index 0000000..13740ee --- /dev/null +++ b/plugins/leaflet/css/contents.css @@ -0,0 +1,25 @@ +.leaflet_div { + background: #eee; + border: 1px solid #ddd; + border-radius: 4pxt; + box-shadow: 0 1px 1px #fff inset, 0 -1px 0px #ccc inset; + margin-right: 1em; +} + +.leaflet_div.align-left { + float: left; +} + +.leaflet_div.align-right { + float: right; +} + +.leaflet_div.align-center { + display: table; + margin-left: auto; + margin-right: auto; +} + +.cke_widget_wrapper:hover>.cke_widget_element { + outline: 3px solid yellow !important; +} diff --git a/plugins/leaflet/dialogs/leaflet.js b/plugins/leaflet/dialogs/leaflet.js new file mode 100644 index 0000000..2f33765 --- /dev/null +++ b/plugins/leaflet/dialogs/leaflet.js @@ -0,0 +1,9 @@ +CKEDITOR.dialog.add("leaflet",function(){return{title:"Create/Edit Leaflet Map",minWidth:320,minHeight:125,contents:[{id:"location_tab",label:"Location",elements:[{id:"map_geocode",className:"geocode",type:"text",label:"Auto-Search of Coordinates.",setup:function(){this.setValue("")},onShow:function(){var a=jQuery(".geocode input")[0];new google.maps.places.Autocomplete(a);a=jQuery(' + + + + + +
+ +
+
+ + + + + + diff --git a/plugins/leaflet/scripts/leaflet-providers/leaflet-providers.js b/plugins/leaflet/scripts/leaflet-providers/leaflet-providers.js new file mode 100644 index 0000000..90fbc91 --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/leaflet-providers.js @@ -0,0 +1,20 @@ +(function(){L.TileLayer.Provider=L.TileLayer.extend({initialize:function(a,b){var f=L.TileLayer.Provider.providers,e=a.split("."),g=e[0],h=e[1];if(!f[g])throw"No such provider ("+g+")";var d={url:f[g].url,options:f[g].options};if(h&&"variants"in f[g]){if(!(h in f[g].variants))throw"No such name in provider ("+h+")";e=f[g].variants[h];d={url:e.url||d.url,options:L.Util.extend({},d.options,e.options)}}else"function"===typeof d.url&&(d.url=d.url(e.splice(1,e.length-1).join(".")));var c=function(a){return-1=== +a.indexOf("{attribution.")?a:a.replace(/\{attribution.(\w*)\}/,function(a,b){return c(f[b].options.attribution)})};d.options.attribution=c(d.options.attribution);e=L.Util.extend({},d.options,b);L.TileLayer.prototype.initialize.call(this,d.url,e)}});L.TileLayer.Provider.providers={OpenStreetMap:{url:"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",options:{attribution:'© OpenStreetMap contributors, CC-BY-SA'}, +variants:{Mapnik:{},BlackAndWhite:{url:"http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png"},DE:{url:"http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png"},HOT:{url:"http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",options:{attribution:'{attribution.OpenStreetMap}, Tiles courtesy of Humanitarian OpenStreetMap Team'}}}},OpenCycleMap:{url:"http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",options:{attribution:'© OpenCycleMap, {attribution.OpenStreetMap}'}}, +OpenSeaMap:{url:"http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png",options:{attribution:'Map data: © OpenSeaMap contributors'}},Thunderforest:{url:"http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",options:{attribution:"{attribution.OpenCycleMap}"},variants:{OpenCycleMap:{},Transport:{url:"http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png"},Landscape:{url:"http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"},Outdoors:{url:"http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png"}}}, +OpenMapSurfer:{url:"http://openmapsurfer.uni-hd.de/tiles/roads/x={x}&y={y}&z={z}",options:{attribution:'Imagery from GIScience Research Group @ University of Heidelberg — Map data {attribution.OpenStreetMap}'},variants:{Roads:{},AdminBounds:{url:"http://openmapsurfer.uni-hd.de/tiles/adminb/x={x}&y={y}&z={z}"},Grayscale:{url:"http://openmapsurfer.uni-hd.de/tiles/roadsg/x={x}&y={y}&z={z}"}}},MapQuestOpen:{url:"http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg", +options:{attribution:'Tiles Courtesy of MapQuest — Map data {attribution.OpenStreetMap}',subdomains:"1234"},variants:{OSM:{},Aerial:{url:"http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",options:{attribution:'Tiles Courtesy of MapQuest — Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'}}}},MapBox:{url:function(a){return"http://{s}.tiles.mapbox.com/v3/"+a+"/{z}/{x}/{y}.png"}, +options:{attribution:'Imagery from MapBox — Map data {attribution.OpenStreetMap}',subdomains:"abcd"}},Stamen:{url:"http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png",options:{attribution:'Map tiles by Stamen Design, CC BY 3.0 — Map data {attribution.OpenStreetMap}',subdomains:"abcd",minZoom:0,maxZoom:20},variants:{Toner:{},TonerBackground:{url:"http://{s}.tile.stamen.com/toner-background/{z}/{x}/{y}.png"}, +TonerHybrid:{url:"http://{s}.tile.stamen.com/toner-hybrid/{z}/{x}/{y}.png"},TonerLines:{url:"http://{s}.tile.stamen.com/toner-lines/{z}/{x}/{y}.png"},TonerLabels:{url:"http://{s}.tile.stamen.com/toner-labels/{z}/{x}/{y}.png"},TonerLite:{url:"http://{s}.tile.stamen.com/toner-lite/{z}/{x}/{y}.png"},Terrain:{url:"http://{s}.tile.stamen.com/terrain/{z}/{x}/{y}.jpg",options:{minZoom:4,maxZoom:18}},TerrainBackground:{url:"http://{s}.tile.stamen.com/terrain-background/{z}/{x}/{y}.jpg",options:{minZoom:4, +maxZoom:18}},Watercolor:{url:"http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg",options:{minZoom:3,maxZoom:16}}}},Esri:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{attribution:"Tiles © Esri"},variants:{WorldStreetMap:{options:{attribution:"{attribution.Esri} — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"}},DeLorme:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}", +options:{minZoom:1,maxZoom:11,attribution:"{attribution.Esri} — Copyright: ©2012 DeLorme"}},WorldTopoMap:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{attribution:"{attribution.Esri} — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community"}},WorldImagery:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", +options:{attribution:"{attribution.Esri} — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"}},WorldTerrain:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:13,attribution:"{attribution.Esri} — Source: USGS, Esri, TANA, DeLorme, and NPS"}},WorldShadedRelief:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}", +options:{maxZoom:13,attribution:"{attribution.Esri} — Source: Esri"}},WorldPhysical:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:8,attribution:"{attribution.Esri} — Source: US National Park Service"}},OceanBasemap:{url:"http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:13,attribution:"{attribution.Esri} — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri"}}, +NatGeoWorldMap:{url:"http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:16,attribution:"{attribution.Esri} — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC"}},WorldGrayCanvas:{url:"http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{maxZoom:16,attribution:"{attribution.Esri} — Esri, DeLorme, NAVTEQ"}}}}, +OpenWeatherMap:{options:{attribution:'Map data © OpenWeatherMap',opacity:0.5},variants:{Clouds:{url:"http://{s}.tile.openweathermap.org/map/clouds/{z}/{x}/{y}.png"},CloudsClassic:{url:"http://{s}.tile.openweathermap.org/map/clouds_cls/{z}/{x}/{y}.png"},Precipitation:{url:"http://{s}.tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png"},PrecipitationClassic:{url:"http://{s}.tile.openweathermap.org/map/precipitation_cls/{z}/{x}/{y}.png"},Rain:{url:"http://{s}.tile.openweathermap.org/map/rain/{z}/{x}/{y}.png"}, +RainClassic:{url:"http://{s}.tile.openweathermap.org/map/rain_cls/{z}/{x}/{y}.png"},Pressure:{url:"http://{s}.tile.openweathermap.org/map/pressure/{z}/{x}/{y}.png"},PressureContour:{url:"http://{s}.tile.openweathermap.org/map/pressure_cntr/{z}/{x}/{y}.png"},Wind:{url:"http://{s}.tile.openweathermap.org/map/wind/{z}/{x}/{y}.png"},Temperature:{url:"http://{s}.tile.openweathermap.org/map/temp/{z}/{x}/{y}.png"},Snow:{url:"http://{s}.tile.openweathermap.org/map/snow/{z}/{x}/{y}.png"}}},Nokia:{options:{attribution:'Map © Nokia, Data © NAVTEQ 2012', +subdomains:"1234",devID:"xyz",appID:"abc"},variants:{normalDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}"},normalGreyDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day.grey/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}"},satelliteNoLabelsDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}"},satelliteYesLabelsDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/hybrid.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}"}, +terrainDay:{url:"http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/terrain.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}"}}},Acetate:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-hillshading/{z}/{x}/{y}.png",options:{attribution:"©2012 Esri & Stamen, Data from OSM and Natural Earth",subdomains:"0123",minZoom:2,maxZoom:18},variants:{all:{},basemap:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-base/{z}/{x}/{y}.png"},terrain:{url:"http://a{s}.acetate.geoiq.com/tiles/terrain/{z}/{x}/{y}.png"}, +foreground:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-fg/{z}/{x}/{y}.png"},roads:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-roads/{z}/{x}/{y}.png"},labels:{url:"http://a{s}.acetate.geoiq.com/tiles/acetate-labels/{z}/{x}/{y}.png"},hillshading:{url:"http://a{s}.acetate.geoiq.com/tiles/hillshading/{z}/{x}/{y}.png"}}}};L.tileLayer.provider=function(a,b){return new L.TileLayer.Provider(a,b)};L.Control.Layers.Provided=L.Control.Layers.extend({initialize:function(a,b,f){var e,g=function(a){return a.replace(/\./g, +": ").replace(/([a-z])([A-Z])/g,"$1 $2")};a.length&&(function(){for(var b={},d=a.length,c=0;ca-this.options.bottomPadding&&(this._container.style.overflowY="scroll");this._container.style.maxHeight=a-this.options.bottomPadding-this.options.topPadding+"px"},_onListScroll:function(){var a= +document.getElementsByClassName("leaflet-minimap-container");if(0!==a.length){var b,e;if(this.isCollapsed())b=e=-1;else{e=a.item(0).clientHeight;b=this._container;var d=b.clientHeight,c=b.scrollTop;b=Math.floor(c/e);e=Math.ceil((c+d)/e)}for(d=0;d=b&&d<=e?(c.hasLayer(f)||f.addTo(c),c.invalidateSize()):c.hasLayer(f)&&c.removeLayer(f))}}},_createMinimap:function(a,b,e){var d=a._miniMap=L.map(a,{attributionControl:!1,zoomControl:!1}); +d.dragging.disable();d.touchZoom.disable();d.doubleClickZoom.disable();d.scrollWheelZoom.disable();d._layer=e?L.layerGroup([g(this.options.overlayBackgroundLayer),g(b)]):g(b);var c=this._map;c.whenReady(function(){d.setView(c.getCenter(),c.getZoom());c.sync(d)})}});L.control.layers.minimap=function(a,b,e){return new L.Control.Layers.Minimap(a,b,e)}})(); \ No newline at end of file diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js b/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js new file mode 100644 index 0000000..2fa0953 --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js @@ -0,0 +1,3 @@ +(function(){L.Map=L.Map.extend({sync:function(a,b){this._initSync();var b=b||{},c=!1;this._syncMaps.forEach(function(b){a===b&&(c=!0)});c||this._syncMaps.push(a);b.noInitialSync||a.setView(this.getCenter(),this.getZoom(),{animate:!1,reset:!0});return this},unsync:function(a){var b=this;this._syncMaps&&this._syncMaps.forEach(function(c,d){a===c&&b._syncMaps.splice(d,1)});return this},_initSync:function(){if(!this._syncMaps){var a=this;this._syncMaps=[];L.extend(a,{setView:function(b,c,d,e){e||a._syncMaps.forEach(function(a){a.setView(b, +c,d,!0)});return L.Map.prototype.setView.call(this,b,c,d)},panBy:function(b,c,d){d||a._syncMaps.forEach(function(a){a.panBy(b,c,!0)});return L.Map.prototype.panBy.call(this,b,c)},_onResize:function(b,c){c||a._syncMaps.forEach(function(a){a._onResize(b,!0)});return L.Map.prototype._onResize.call(this,b)}});a.on("zoomend",function(){a._syncMaps.forEach(function(b){b.setView(a.getCenter(),a.getZoom(),{animate:!1,reset:!1})})},this);a.dragging._draggable._updatePosition=function(){L.Draggable.prototype._updatePosition.call(this); +var b=this;a._syncMaps.forEach(function(a){L.DomUtil.setPosition(a.dragging._draggable._element,b._newPos);a.fire("moveend")})}}}})})(); \ No newline at end of file diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/control.layers.minimap.css b/plugins/leaflet/scripts/leaflet-providers/preview/control.layers.minimap.css new file mode 100644 index 0000000..389cd31 --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/control.layers.minimap.css @@ -0,0 +1,35 @@ +.leaflet-control-layers-expanded.leaflet-control-layers-minimap { + width: 240px; + background: rgba(255, 255, 255, 0.85); + box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); + + padding: 0; + border: 4px solid rgba(255, 255, 255, 0.8); + border-radius: 5px; + overflow-x: hidden; +} +.leaflet-minimap-container { + margin-bottom: 2px; + position: relative; + display: block; + height: 110px; +} +.leaflet-minimap-container .leaflet-minimap-label { + position: absolute; + display: block; + + height: 22px; + bottom: 0; + left: 0; + padding: 2px 6px 2px 2px; + background-color: rgba(0, 0, 0, 0.7); + color: white; + white-space: nowrap; +} +.leaflet-minimap-container .leaflet-minimap-label .leaflet-control-layers-selector { + top: 3px; +} +.leaflet-minimap { + width: 100%; + height: 100%; +} diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/LICENSE b/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/LICENSE new file mode 100644 index 0000000..422deb7 --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2006, Ivan Sagalaev +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of highlight.js nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/github.css b/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/github.css new file mode 100644 index 0000000..a73ba3e --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/github.css @@ -0,0 +1,127 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +pre code { + display: block; padding: 0.5em; + color: #333; + background: #f8f8ff +} + +pre .comment, +pre .template_comment, +pre .diff .header, +pre .javadoc { + color: #998; + font-style: italic +} + +pre .keyword, +pre .css .rule .keyword, +pre .winutils, +pre .javascript .title, +pre .nginx .title, +pre .subst, +pre .request, +pre .status { + color: #333; + font-weight: bold +} + +pre .number, +pre .hexcolor, +pre .ruby .constant { + color: #099; +} + +pre .string, +pre .tag .value, +pre .phpdoc, +pre .tex .formula { + color: #d14 +} + +pre .title, +pre .id { + color: #900; + font-weight: bold +} + +pre .javascript .title, +pre .lisp .title, +pre .clojure .title, +pre .subst { + font-weight: normal +} + +pre .class .title, +pre .haskell .type, +pre .vhdl .literal, +pre .tex .command { + color: #458; + font-weight: bold +} + +pre .tag, +pre .tag .title, +pre .rules .property, +pre .django .tag .keyword { + color: #000080; + font-weight: normal +} + +pre .attribute, +pre .variable, +pre .lisp .body { + color: #008080 +} + +pre .regexp { + color: #009926 +} + +pre .class { + color: #458; + font-weight: bold +} + +pre .symbol, +pre .ruby .symbol .string, +pre .lisp .keyword, +pre .tex .special, +pre .prompt { + color: #990073 +} + +pre .built_in, +pre .lisp .title, +pre .clojure .built_in { + color: #0086b3 +} + +pre .preprocessor, +pre .pi, +pre .doctype, +pre .shebang, +pre .cdata { + color: #999; + font-weight: bold +} + +pre .deletion { + background: #fdd +} + +pre .addition { + background: #dfd +} + +pre .diff .change { + background: #0086b3 +} + +pre .chunk { + color: #aaa +} diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/highlight.pack.js b/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/highlight.pack.js new file mode 100644 index 0000000..1e6658a --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/highlightjs/highlight.pack.js @@ -0,0 +1,14 @@ +var hljs=new function(){function j(a){return a.replace(/&/gm,"&").replace(//gm,">")}function w(a){for(a=a.firstChild;a;a=a.nextSibling){if("CODE"==a.nodeName)return a;if(!(3==a.nodeType&&a.nodeValue.match(/\s+/)))break}}function o(a,c){return Array.prototype.map.call(a.childNodes,function(a){return 3==a.nodeType?c?a.nodeValue.replace(/\n/g,""):a.nodeValue:"BR"==a.nodeName?"\n":o(a,c)}).join("")}function x(a){for(var a=(a.className+" "+a.parentNode.className).split(/\s+/), +a=a.map(function(a){return a.replace(/^language-/,"")}),c=0;c"}for(var f=0,d="",g=[];a.length||c.length;){var e=(a.length&&c.length?a[0].offset!=c[0].offset?a[0].offset";while(h!=e.node);for(g.splice(l,1);l'+a.value+"");else if(a=j(h),e.k){var b="",c=0;e.lR.lastIndex=0;for(var d=e.lR.exec(a);d;){var b=b+a.substr(c,d.index-c),c=e,f=d,f=g.cI?f[0].toLowerCase():f[0];(c=c.k.hasOwnProperty(f)&&c.k[f])?(m+=c[1],b+=''+d[0]+""):b+=d[0];c=e.lR.lastIndex;d=e.lR.exec(a)}a=b+a.substr(c)}return a}function f(a,b){var c=a.cN?'':"";a.rB?(k+=c,h=""):a.eB?(k+=j(b)+c,h=""):(k+=c,h=b);e=Object.create(a,{parent:{value:e}}); +l+=a.r}function d(a,c){h+=a;if(void 0===c)return k+=b(),0;var d;a:{d=e;for(var g=0;gi.keyword_count+i.r&&(i=f);f.keyword_count+f.r>c.keyword_count+c.r&&(i=c,c=f)}i.language&&(c.second_best=i);return c}function u(a,c,i){c&&(a=a.replace(/^((<[^>]+>|\t)+)/gm, +function(a,f){return f.replace(/\t/g,c)}));i&&(a=a.replace(/\n/g,"
"));return a}function v(a,c,i){var b=o(a,i),f=x(a);if("no-highlight"!=f){var d=f?s(f,b):t(b),f=d.language,g=p(a);if(g.length){var e=document.createElement("pre");e.innerHTML=d.value;d.value=y(g,p(e),b)}d.value=u(d.value,c,i);c=a.className;c.match("(\\s|^)(language-)?"+f+"(\\s|$)")||(c=c?c+" "+f:f);a.innerHTML=d.value;a.className=c;a.result={language:f,kw:d.keyword_count,re:d.r};d.second_best&&(a.second_best={language:d.second_best.language, +kw:d.second_best.keyword_count,re:d.second_best.r})}}function m(){m.called||(m.called=!0,Array.prototype.map.call(document.getElementsByTagName("pre"),w).filter(Boolean).forEach(function(a){v(a,hljs.tabReplace)}))}var n={};this.LANGUAGES=n;this.highlight=s;this.highlightAuto=t;this.fixMarkup=u;this.highlightBlock=v;this.initHighlighting=m;this.initHighlightingOnLoad=function(){window.addEventListener("DOMContentLoaded",m,!1);window.addEventListener("load",m,!1)};this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR= +"[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM= +{cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(a,c){var i={},b;for(b in a)i[b]=a[b];if(c)for(b in c)i[b]=c[b];return i}}; +hljs.LANGUAGES.javascript=function(j){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[j.ASM,j.QSM,j.CLCM,j.CBLCLM,j.CNM,{b:"("+j.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[j.CLCM,j.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",i:"\\n",c:[{b:"\\\\/"}]},{b:"<",e:">;",sL:"xml"}],r:0},{cN:"function",bWK:!0, +e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[j.CLCM,j.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}(hljs); \ No newline at end of file diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/index.html b/plugins/leaflet/scripts/leaflet-providers/preview/index.html new file mode 100644 index 0000000..45e0015 --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/index.html @@ -0,0 +1,90 @@ + + + + Leaflet Provider Demo + + + + + + + + + + + + + + + + +
+

Leaflet-providers preview

+

+ This page shows mini maps for all the layers available in Leaflet-providers. +

+
+
+ + + + + + + + + + + + diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/preview.js b/plugins/leaflet/scripts/leaflet-providers/preview/preview.js new file mode 100644 index 0000000..b38cc2e --- /dev/null +++ b/plugins/leaflet/scripts/leaflet-providers/preview/preview.js @@ -0,0 +1,4 @@ +(function(){var g=new L.Map("map",{zoomControl:!1,center:[48,-3],zoom:5}),m=L.TileLayer.prototype.initialize;L.TileLayer.include({initialize:function(a,b){this._options=b;m.apply(this,arguments)}});var n=L.TileLayer.Provider.prototype.initialize;L.TileLayer.Provider.include({initialize:function(a){this._providerName=a;n.apply(this,arguments)}});var h={},k={},l=function(a){null!==a.match("(^(OpenWeatherMap|OpenSeaMap)|OpenMapSurfer.AdminBounds|Stamen.Toner(Hybrid|Lines|Labels)|Acetate.(foreground|labels|roads))")? +k[a]=L.tileLayer.provider(a):h[a]=L.tileLayer.provider(a)},e;for(e in L.TileLayer.Provider.providers)if(null===e.match(/^(MapBox|OpenSeaMap)/))if(L.TileLayer.Provider.providers[e].variants)for(var o in L.TileLayer.Provider.providers[e].variants)l(e+"."+o);else l(e);L.control.layers.minimap(h,k,{collapsed:!1}).addTo(g);h["OpenStreetMap.Mapnik"].addTo(g);g.addControl(new (L.Control.extend({options:{position:"topleft"},onAdd:function(a){var b=L.DomUtil.get("info");L.DomEvent.disableClickPropagation(b); +L.DomUtil.create("h4",null,b).innerHTML="Provider names for leaflet-providers.js";var e=L.DomUtil.create("code","provider-names",b);L.DomUtil.create("h4","",b).innerHTML="Plain JavaScript:";var f=L.DomUtil.create("pre",null,b),j=L.DomUtil.create("code","javascript",f),f=function(b){j.innerHTML="";var f=[],g;for(g in a._layers){var d=a._layers[g];f.push(d._providerName);var c=d._providerName.replace(".","_");if(!b||!("layerremove"===b.type&&d===b.layer)){var c="var "+c+" = L.tileLayer('"+ +d._url+"', {\n",d=d._options,h=!0,i;for(i in d)h?h=!1:c+=",\n",c+="\t"+i+": ",c="string"===typeof d[i]?c+("'"+d[i].replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")+"'"):c+d[i];c+="\n});\n";j.innerHTML+=c;e.innerHTML=f.join(", ")}}hljs.highlightBlock(j)};a.on({layeradd:f,layerremove:f});f();return b}})))})(); \ No newline at end of file diff --git a/plugins/leaflet/scripts/mapParser.html b/plugins/leaflet/scripts/mapParser.html new file mode 100644 index 0000000..5092536 --- /dev/null +++ b/plugins/leaflet/scripts/mapParser.html @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.3