PluginProbe
Leaflet Map / 2.17.2
Leaflet Map v2.17.2
3.4.7 3.4.6 trunk 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.11.5 2.12.0 2.13.0 2.14.0 2.15.0 2.16.0 2.16.1 2.16.2 2.17.0 2.17.1 2.17.2 2.17.3 2.18.0 2.19.0 2.19.1 All 49 releases
leaflet-map / readme.txt

readme.txt in Leaflet Map 2.17.2, at readme.txt

480 lines 17.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 === Leaflet Map ===
2 Author: bozdoz
3 Author URI: https://bozdoz.com
4 Plugin URI: https://wordpress.org/plugins/leaflet-map/
5 Contributors: bozdoz, remigr, gerital, sal0max
6 Donate link: https://www.paypal.me/bozdoz
7 Tags: leaflet, map, mobile, javascript, openstreetmap, mapquest, interactive
8 Requires at least: 4.6
9 Tested up to: 5.3.2
10 Version: 2.17.2
11 Stable tag: 2.17.2
12 License: GPLv2
13 License URI: https://www.gnu.org/licenses/gpl-2.0.html
14
15 Interactive maps and markers on your posts and pages with simple shortcodes.
16
17 == Description ==
18
19 Add a map generated with [LeafletJS](http://leafletjs.com/): an open-source JavaScript library for mobile-friendly interactive maps. Map tiles are provided by default through [OpenStreetMap](http://www.openstreetmap.org/), or [MapQuest](https://www.mapquest.ca/) (with an app key). Can be set per map with shortcode attributes or through the dashboard settings.
20
21 = Maps =
22
23 Simply create a **map** with:
24
25 `[leaflet-map]`
26
27 Lookup an address with:
28
29 `[leaflet-map address="chicago"]`
30
31 Know the latitude and longitude of a location? Use them (and a zoom level) with:
32
33 `[leaflet-map lat=44.67 lng=-63.61 zoom=5]`
34
35 Add a **marker** under your map shortcode, like so:
36
37 `
38 [leaflet-map]
39 [leaflet-marker]
40 `
41
42 Want more? Make more (and fit the map to contain all of them):
43
44 `
45 [leaflet-map fitbounds]
46 [leaflet-marker address="tokyo"]
47 [leaflet-marker address="oslo"]
48 [leaflet-marker address="cairo"]
49 [leaflet-marker address="toronto"]
50 `
51
52 You can even add **popups** (to any shape) with their names:
53
54 `
55 [leaflet-map fitbounds]
56 [leaflet-marker address="tokyo"]Tokyo[/leaflet-marker]
57 [leaflet-marker address="oslo"]Oslo[/leaflet-marker]
58 ...
59 `
60
61 Add a link to the popup messages the same way you would add any other link with the WordPress editor.
62
63 = Other Shapes, GeoJSON, and KML =
64
65 Add a line to the map by adding `[leaflet-line]`. You can specify the postions with a list separated by semi-colon `;` or bar `|` using lat/lng: `[leaflet-line latlngs="41, 29; 44, 18"]` or addresses: `[leaflet-line addresses="Istanbul; Sarajevo"]`, or x/y coordinates for image maps.
66
67 Add a circle to the map by adding `[leaflet-circle]`. You can specify the position using `lat` and `lng` and the radius in meters using `radius`. You can also customize the style using [Leaflet's Path options](https://leafletjs.com/reference-1.3.4.html#path-option). Example: `[leaflet-circle message="max distance" lng=5.117909610271454 lat=52.097914814706094 radius=17500 color="#0DC143" fillOpacity=0.1]`.
68
69 Or you can add a geojson shape via a url (make sure you are allowed to access it if it's not hosted on your own server): `[leaflet-geojson src="https://example.com/path/to.geojson"]`. Add custom popups with field names; try out the default src file and fields like so (note fitbounds needs to be on leaflet-geojson (for now)):
70
71 `
72 [leaflet-map]
73 [leaflet-geojson fitbounds]{name}[/leaflet-geojson]
74 `
75
76 `name` is a property on that GeoJSON, and it can be accessed with curly brackets and the property name.
77
78 = Image Maps =
79
80 Alternatively, you could use a plain image for visitors to zoom and pan around with `[leaflet-image src="path/to/image/file.jpg"]`. See screenshots 3 - 5 for help setting that up.
81
82 = More =
83
84 Check out other examples on the Shortcode Helper page in the Leaflet Map admin section.
85
86 Check out the **source code** and **more** details on [GitHub](https://github.com/bozdoz/wp-plugin-leaflet-map)!
87
88 == Installation ==
89
90 1. Choose to add a new plugin, then click upload
91 2. Upload the leaflet-map zip
92 3. Activate the plugin through the 'Plugins' menu in WordPress
93 4. Use the shortcodes in your pages or posts: e.g. `[leaflet-map]` and `[leaflet-marker]`
94
95 == Frequently Asked Questions ==
96
97 = Can I have an SVG Marker? =
98
99 Yes! Convert the default marker into an svg with a shortcode like this: `[leaflet-marker svg color="white" iconClass="fab fa-wordpress-simple" background="red"]` The `iconClass` is perfect for adding a [font-awesome](https://fontawesome.com/icons?d=gallery) icon.
100
101 = How do I change the style for lines/geojson? =
102
103 Pass the style attributes to the respective shortcodes (see all options on [LeafletJS](http://leafletjs.com/reference-1.0.3.html#path)):
104
105 `[leaflet-line color="red" weight=10 dasharray="2,15" addresses="Halifax, NS; Tanzania" classname=marching-ants]`
106
107 = My map now says direct tile access has been discontinued (July 11, 2016); can you fix it? =
108
109 Yes. Update to the newest plugin version, and reset defaults in settings. You can choose to use MapQuest by signing up and supplying an app key, or use the default OpenStreetMap tiles (with attribution). See Screenshot 8.
110
111 = Can I add geojson? =
112
113 Yes, just give it a source URL: `[leaflet-geojson src="https://example.com/path/to.geojson"]` It will also support leaflet geojson styles or geojson.io styles. Add a popup message with `[leaflet-geojson popup_text="hello!"]`, or add HTML by adding it to the content of the shortcode: `[leaflet-geojson]<a href="#">Link here, or use text from a feature property, like {title}</a>[/leaflet-geojson]` or identify a geojson property with `popup_property`, and each shape will use its own popup text if available.
114
115 = Can I add kml/gpx? =
116
117 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` or `[leaflet-gpx]` shortcode.
118
119 = Can I add a message to a marker? =
120
121 Yes: `[leaflet-marker message="Hello there!" visible]`, where visible designates if it is visible on page load. Otherwise it is only visible when clicked.
122
123 = Can I use your plugin with a picture instead of a map? =
124
125 Yes: Use `[leaflet-image src="path/to/image/file.jpg"]`. See screenshots 3 - 5 for help setting that up.
126
127 = Can I use my own self-hosted Leaflet files? =
128
129 Yes: It's been added to the dashboard options!
130
131 = How can I add a link to a marker? =
132
133 Use the marker format `[leaflet-marker]Click here![/leaflet-marker]` and add a hyperlink like you normally would with the WordPress editor.
134
135 = Can I add a line to the map? =
136
137 Use the line format `[leaflet-line]` with attributes `latlngs` or `addresses` separated by semi-colons to draw a line: `[leaflet-line addresses="Sayulita; Puerto Vallarta"]`.
138
139 = Can I add my own attributions to custom tile layers? =
140
141 Yes: use the keyword `attribution` in your shortcode (semi-colon separated list of attributions): `[leaflet-map attribution="Tiles courtesy of MapBox; Locations contributed by viewers"]`
142
143 == Screenshots ==
144
145 1. Put the shortcode into the post.
146 2. See the shortcode play out on the front end.
147 3. For `[leaflet-image]` upload an image, and copy the URL from the right-hand side
148 4. For `[leaflet-image]` paste that image URL into an attribute titled `source`: example: `src="https://picsum.photos/1000/1000/"`.
149 5. See the `[leaflet-image]` on the front end.
150 6. If you use `[leaflet-marker draggable]`, then you can drag the marker where you want it, open a developers console, and see the specific shortcode to use.
151 7. Add geojson via URL: `[leaflet-geojson src="https://example.com/path/to.geojson"]`
152 8. MapQuest requires an app key, get it from their website; alternatively, you can use OpenStreetMap as a free tile service (remember to add an attribution where necessary).
153
154 == Changelog ==
155
156 = 2.17.2 =
157 * Unparenthesized ternaries are deprecated in php 7.4
158
159 = 2.17.1 =
160 * Lazy-loading svg and geojson scripts so that it can wait for Leaflet to be loaded under some circumstances (deferred scripts)
161
162 = 2.17.0 =
163 * Adds `detect-retina` to plugin options and `leaflet-map` shortcode
164 * Makes shortcode in excerpts conditional (enable it in admin->leaflet-map->settings)
165
166 = 2.16.2 =
167 * Fix to wpautop by removing spaces in javascript
168
169 = 2.16.1 =
170 * Updates default Leaflet to 1.6.0
171 * Adds optional circle markers as [leaflet-geojson circleMarker]
172 * removes random unique map id's for caching purposes
173
174 = 2.16.0 =
175 * allow author roles to see shortcodes
176 * adds [leaflet-polygon] shortcode
177 * makes map ids unique; removes auto-incremented map counts
178
179 = 2.15.0 =
180 * Updates rawgit URL's to use jsdelivr, unpkg, and githubusercontent.com
181 * Change logo to use FontAwesome SVG
182 * Adds referer to file_get_contents, in case curl is disabled
183 * Updates default Leaflet to 1.5.1
184 * Fixes reset default values button in settings
185 * Requires at least WordPress 4.6
186 * ToGeoJSON library URL is customizable
187
188 = 2.14.0 =
189 * Fix `visible` att in popups.
190 * Adds nested property accessors to geojson popup text: `{attributes.email}`
191 * Adds negation to shortcode attributes with an exclamation mark: e.g. Disable all interaction with `[leaflet-map address="las vegas" !boxZoom !doubleClickZoom !dragging !keyboard !scrollwheel !attribution !touchZoom]`
192 * Fix case-sensitive `boxZoom`
193 * Add `touchZoom` to map attributes
194 * Fix icon-related anchor attributes (numbers instead of strings)
195
196 = 2.13.0 =
197 * Updated LeafletJS to 1.4.0
198 * Replaced `fit_markers` with `fitbounds`, which now fits all shapes in map view
199
200 = 2.12.0 =
201 * Re-added Google Geocoder (optional), since they forced billing accounts
202 * Fixed links in shortcode helper page
203 * Fixed issue with marker popups that had single quotes
204 * Loading leaflet scripts and styles only when a map shortcode is used
205 * Added fitbounds to leaflet-map (to replace fit_markers someday)
206
207 = 2.11.5 =
208 * Added assumed-boolean attributes to all shortcodes; ex: `[leaflet-marker draggable svg]` would be the same as `[leaflet-marker draggable=1 svg=1]`
209
210 = 2.11.4 =
211 * Fix to a race condition issue with custom scripts changing leaflet rendering methods
212
213 = 2.11.3 =
214 * Fix to an issue with rendering circles
215
216 = 2.11.2 =
217 * Allow scripts to be deferred, and still render maps reliably
218 * Add a circle to the map by adding `[leaflet-circle]`
219
220 = 2.11.1 =
221 * Added Dockerfiles to github
222 * Made OpenStreetMap default geocoder in light of new Google API payment plans
223
224 = 2.11.0 =
225 * Added Popup Anchor for custom markers
226 * Added SVG Markers
227 * Added actions and filters
228
229 = 2.10.1 =
230 * Fix for plugin settings not being included (somehow)
231
232 = 2.10.0 =
233 * Added functions for translating text
234 * Added string interpolation for GeoJSON popups to use feature properties (thanks to [@geraldo](https://github.com/geraldo))
235
236 = 2.9.1 =
237 * Fixes for PHP 7.2: made all method arguments identical
238 * Added minified JavaScript files for site speed
239
240 = 2.8.6 =
241 * Added [leaflet-gpx] for GPX format
242
243 = 2.8.6 =
244 * Fix image shortcode ratio
245
246 = 2.8.5 =
247 * Added missing files from 2.8.4
248
249 = 2.8.4 =
250 * Fixed issues with css and js CDN; removed version from querystring
251 * Split admin into new class
252
253 = 2.8.3 =
254 * Fix to [leaflet-kml]
255 * Standardized `src` in leaflet-image and leaflet-geojson/kml
256
257 = 2.8.2 =
258 * Fix to image maps
259 * Fixes to geocoder
260 * Added multi-line popups to markers and geojson/kml
261
262 = 2.8.1 =
263 * Code cleanup
264 * Added server-side and client-side methods to prevent WordPress from adding paragraph tags within shortcode tags
265
266 = 2.8.0 =
267 * Added Fit Markers to settings and map shortcode: [leaflet-map fit_markers=1]
268 * Moved geojson/kml popup text to the shortcode content instead of a property so that you can use links or other HTML
269
270 = 2.7.8 =
271 * update default Leaflet version (1.1.0 from 1.0.3)
272
273 = 2.7.7 =
274 * added default lat/lngs in the admin; and reordered admin fields to be more user friendly
275
276 = 2.7.6 =
277 * added optional cURL to get geolocations if file_get_contents is not allowed on a server (note: cURL needs to be enabled, obviously)
278
279 = 2.7.5 =
280 * fixed filter_var_array throwing errors in old PHP too
281
282 = 2.7.4 =
283 * Added settings link to plugins page
284
285 = 2.7.3 =
286 * Fix to array_filter on some PHP versions.
287
288 = 2.7.2 =
289 * Fix to possible JavaScript error "Unexpected token <"; only happened when a plugin/theme used `wpautop`; fix was to remove spaces.
290
291 = 2.7.1 =
292 * Removed unnecessary map counts;
293
294 = 2.7.0 =
295 * Added basic marker icon support (with attributes "iconUrl", "iconAnchor", etc.);
296
297 = 2.6.0 =
298 * Changes to map creation which may solve an occasional marker creation JavaScript error
299 * Added more attributes to marker shortcode (draggable, title, alt, opacity)
300 * Added doubleClickZoom global, database option to globally disable double click zooming (by default), because it's more inline with disabling scroll zooming by default. Box zooming on the other hand is more intentional
301
302 = 2.5.0 =
303 * Some improvements to the codebase;
304 * added the same styling options for lines as there are for geojson;
305 * added popups to lines, as there are for markers;
306 * added an example to the shortcode admin page for the style attributes on lines;
307 * added code and another example for disabling all map interactions (all zooms, keyboard, etc);
308
309 = 2.4.0 =
310 * Added Leaflet 1.0.2 scripts by default (works!);
311
312 = 2.3.0 =
313 * Added KML support `[leaflet-kml]`;
314
315 = 2.2.0 =
316 * Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties
317
318 = 2.1.0 =
319 * Added Leaflet and GeoJSON.io styles to geojson shortcode
320
321 = 2.0.2 =
322 * OpenStreetMap.org has an SSL certificate (osm.org didn't); not a significant upgrade.
323
324 = 2.0.1 =
325 * Changed ajax request to be compatible with some versions of IE.
326
327 = 2.0 =
328 * Needed to add support for a MapQuest app key, since they discontinued the direct access of their tiles on July 11, 2016; added an alternate OpenStreetMap tile URL as the new default. Remember to reset options to default values!
329
330 = 1.16 =
331 * Added bare geojson support
332
333 = 1.15 =
334 * Removed shortcode brackets from leaflet-marker shortcode
335
336 = 1.14 =
337 * Fixed slashes in optional map attribution
338
339 = 1.13 =
340 * Added new geocoder options (thanks to [@nielsalstrup](https://github.com/nielsalstrup) for DAWA and [@jeromelebleu](https://github.com/nielsalstrup) for OSM)
341
342 = 1.12 =
343 * Added htmlspecialchars in admin.php, and custom attributions. Bugfix : removed position in admin menu so it doesn't overwrite or be overwritten (thanks to [@ziodave](https://github.com/ziodave))
344
345 = 1.11 =
346 * Added HTTPS support.
347
348 = 1.10 =
349 * Added lines to the map, thanks to [@Remigr](https://github.com/Remigr)!
350
351 = 1.9 =
352 * Added ability to use hyperlinks in marker messages.
353
354 = 1.8 =
355 * Added ability to self-host leaflet files.
356
357 = 1.7 =
358 * Uploaded 1.6 to subversion incorrectly!
359
360 = 1.6 =
361 * Important fix to conflicts with other plugins!
362
363 = 1.5 =
364 * Some helpful js fixes for multiple window onload functions, and added the `leaflet-image` shortcode!
365
366 = 1.4 =
367 * Some fixes for Google geocoding, and switched cookies to db options.
368
369 = 1.3 =
370 * Added cookies for Google geocoding to cut back on requests.
371
372 = 1.2 =
373 * Added geocoding to map: `[leaflet-map address="halifax, ns"]`.
374
375 = 1.1 =
376 * Added messages to markers.
377
378 = 1.0 =
379 * First Version. Basic map creation and marker creation.
380
381 == Upgrade Notice ==
382
383 = 2.17.1 =
384 Lazy-loading svg and geojson scripts so that it can wait for Leaflet to be loaded under some circumstances (deferred scripts)
385
386 = 2.17.0 =
387 Makes shortcode in excerpts conditional (enable it in admin->leaflet-map->settings)
388
389 = 2.16.2 =
390 Fixes missing maps by removing spaces in the JavaScript which some themes turn into paragraphs
391
392 = 2.16.1 =
393 Updates default Leaflet to 1.6.0
394 Changes map generation from a pre-defined randomly identified div element to a JavaScript generated div which is created (insertBefore) each inserted script tag
395
396 = 2.16.0 =
397 Adds [leaflet-polygon]
398 Allows author roles to see shortcodes page
399
400 = 2.15.0 =
401 Adds referer to file_get_contents, in case curl is disabled
402 Updates default Leaflet to 1.5.1
403 Fixes reset default values button in settings
404 Requires at least WordPress 4.6
405
406 = 2.12.0 =
407 Fixed links in shortcode helper page; fixed issue with marker popups that had single quotes; loading leaflet scripts and styles only when a map shortcode is used
408
409 = 2.11.4 =
410 Fix to a race condition issue with custom scripts changing leaflet rendering methods
411
412 = 2.11.3 =
413 Fix for rendering circles (fix to 2.11.2)
414
415 = 2.10.1 =
416 Fix for plugin settings not being included (somehow)
417
418 = 2.9.1 =
419 Fix for PHP7.2; added minified JavaScript files
420
421 = 2.8.6 =
422 Added [leaflet-gpx] for GPX format
423
424 = 2.8.6 =
425 Fix image shortcode ratio
426
427 = 2.8.5 =
428 Fix to missing files in 2.8.4
429
430 = 2.8.4 =
431 Fixed issues with css and js CDN; removed version from querystring
432
433 = 2.8.3 =
434 Fixed issues with leaflet-kml
435
436 = 2.8.2 =
437 Fixed issues with image maps and geocoder addresses
438
439 = 2.7.6 =
440 added optional cURL to get geolocations if file_get_contents is not allowed on a server (cURL needs to be enabled, obviously)
441
442 = 2.7.5 =
443 fixed filter_var_array throwing errors in old PHP
444
445 = 2.7.3 =
446 Fixed array_filter on some older PHP versions
447
448 = 2.7.2 =
449 Fixed possible JavaScript error "Unexpected token <"; fix was to remove spaces
450
451 = 2.6.0 =
452 Changes to map creation which may solve an occasional marker creation JavaScript error
453
454 = 2.0.2 =
455 OpenStreetMap.org has an SSL certificate (osm.org didn't)
456
457 = 2.0.1 =
458 GeoJSON ajax requests now work with Internet Explorer (some versions)
459
460 = 2.0 =
461 MapQuest tiles will no longer work without an app key!
462
463 = 1.15 =
464 Fixed incompatibility with plugins that execute recursive shortcodes
465
466 = 1.14 =
467 Fixed slashes in optional map attribution
468
469 = 1.12 =
470 Added htmlspecialchars in admin.php, and custom attributions. Bugfix : removed position in admin menu so it doesn't overwrite or be overwritten (thanks to [@ziodave](https://github.com/ziodave))
471
472 = 1.6 =
473 Removed windows onload functions and created a construct and init js file for initiating the maps when Leaflet is ready (other plugins were overwriting windows.onload).
474
475 = 1.5 =
476 Improved stability for multiple plugins with windows onload functions.
477
478 = 1.0 =
479 First Version. Tested with 3.8.1.
480