PluginProbe
Leaflet Map / 2.11.2
Leaflet Map v2.11.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.11.2, at readme.txt

360 lines 13.6 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://www.twitter.com/bozdoz/
4 Plugin URI: https://wordpress.org/plugins/leaflet-map/
5 Contributors: bozdoz, Remigr, nielsalstrup, jeromelebleu, gerital, peteruithoven
6 Donate link: https://www.paypal.me/bozdoz
7 Tags: leaflet, map, mobile, javascript, openstreetmap, mapquest, interactive
8 Requires at least: 3.0.1
9 Tested up to: 4.9.8
10 Version: 2.11.2
11 Stable tag: 2.11.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 Height, width, latitude, longitude and zoom are the basic attributes:
24
25 `[leaflet-map height=250 width=250 lat=44.67 lng=-63.61 zoom=5]`
26
27 However, you can also just give it an **address**, and Google (by default) will look it up for you:
28
29 `[leaflet-map address="Oslo, Norway"]`
30
31 The default URL requires attribution by its terms of use. If you want to change the URL, you may define a new attribution, or remove the attribution. You can define this site-wide in the admin, or you can set this per map in the shortcode (0 for disabled):
32
33 `[leaflet-map attribution=0]`
34
35 OR
36
37 `[leaflet-map attribution="Copyright @bozdoz"]`
38
39 Look at other examples on the Shortcode Helper in the Leaflet Map admin section.
40
41 = Markers =
42
43 Add a marker to any map by adding `[leaflet-marker]` after any `[leaflet-map]` shortcode. You can adjust the lat/lng in the same way, as well as some other basic functionality (popup message, draggable, visible on load). Also, if you want to add a link to a marker popup, use this syntax: `[leaflet-marker]Message here: click here[/leaflet-marker]` and add a link like you normally would with the WordPress editor.
44
45 = Lines and other Shapes =
46
47 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.
48
49 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]`.
50
51 Or you can add a geojson shape via a url (work in progress): `[leaflet-geojson src="https://example.com/path/to.geojson"]`
52
53 = Image Maps =
54
55 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.
56
57 Check out the source code on [GitHub](https://github.com/bozdoz/wp-plugin-leaflet-map)!
58
59 Shoot me a question [@bozdoz](https://www.twitter.com/bozdoz/).
60
61 == Installation ==
62
63 1. Choose to add a new plugin, then click upload
64 2. Upload the leaflet-map zip
65 3. Activate the plugin through the 'Plugins' menu in WordPress
66 4. Use the shortcodes in your pages or posts: e.g. `[leaflet-map]` and `[leaflet-marker]`
67
68 == Frequently Asked Questions ==
69
70 = Can I have an SVG Marker? =
71
72 Yes! Convert the default marker into an svg with a shortcode like this: `[leaflet-marker svg="true" 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.
73
74 = How do I change the style for lines/geojson? =
75
76 Pass the style attributes to the respective shortcodes (see all options on [LeafletJS](http://leafletjs.com/reference-1.0.3.html#path)):
77
78 `[leaflet-line color="red" weight=10 dasharray="2,15" addresses="Halifax, NS; Tanzania" classname=marching-ants]`
79
80 = My map now says direct tile access has been discontinued (July 11, 2016); can you fix it? =
81
82 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.
83
84 = Can I add geojson? =
85
86 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.
87
88 = Can I add kml/gpx? =
89
90 Sure!? Use the same attributes as leaflet-geojson (above), but use the `[leaflet-kml]` or `[leaflet-gpx]` shortcode.
91
92 = Can I add a message to a marker? =
93
94 Yes: `[leaflet-marker message="Hello there!" visible="true"]`, where visible designates if it is visible on page load. Otherwise it is only visible when clicked.
95
96 = Can I use your plugin with a picture instead of a map? =
97
98 Yes: Use `[leaflet-image src="path/to/image/file.jpg"]`. See screenshots 3 - 5 for help setting that up.
99
100 = Can I use my own self-hosted Leaflet files? =
101
102 Yes: It's been added to the dashboard options!
103
104 = How can I add a link to a marker? =
105
106 Use the marker format `[leaflet-marker]Click here![/leaflet-marker]` and add a hyperlink like you normally would with the WordPress editor.
107
108 = Can I add a line to the map? =
109
110 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"]`.
111
112 = Can I add my own attributions to custom tile layers? =
113
114 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"]`
115
116 == Screenshots ==
117
118 1. Put the shortcode into the post.
119 2. See the shortcode play out on the front end.
120 3. For `[leaflet-image]` upload an image, and copy the URL from the right-hand side
121 4. For `[leaflet-image]` paste that image URL into an attribute titled `source`: example: `src="http://lorempixel.com/1000/1000/"`.
122 5. See the `[leaflet-image]` on the front end.
123 6. If you use `[leaflet-marker draggable=true]`, then you can drag the marker where you want it, open a developers console, and see the specific shortcode to use.
124 7. Add geojson via URL: `[leaflet-geojson src="https://example.com/path/to.geojson"]`
125 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).
126
127 == Changelog ==
128
129 = 2.11.2 =
130 * Allow scripts to be deferred, and still render maps reliably
131 * Add a circle to the map by adding `[leaflet-circle]`
132
133 = 2.11.1 =
134 * Added Dockerfiles to github
135 * Made OpenStreetMap default geocoder in light of new Google API payment plans
136
137 = 2.11.0 =
138 * Added Popup Anchor for custom markers
139 * Added SVG Markers
140 * Added actions and filters
141
142 = 2.10.1 =
143 * Fix for plugin settings not being included (somehow)
144
145 = 2.10.0 =
146 * Added functions for translating text
147 * Added string interpolation for GeoJSON popups to use feature properties (thanks to [@geraldo](https://github.com/geraldo))
148
149 = 2.9.1 =
150 * Fixes for PHP 7.2: made all method arguments identical
151 * Added minified JavaScript files for site speed
152
153 = 2.8.6 =
154 * Added [leaflet-gpx] for GPX format
155
156 = 2.8.6 =
157 * Fix image shortcode ratio
158
159 = 2.8.5 =
160 * Added missing files from 2.8.4
161
162 = 2.8.4 =
163 * Fixed issues with css and js CDN; removed version from querystring
164 * Split admin into new class
165
166 = 2.8.3 =
167 * Fix to [leaflet-kml]
168 * Standardized `src` in leaflet-image and leaflet-geojson/kml
169
170 = 2.8.2 =
171 * Fix to image maps
172 * Fixes to geocoder
173 * Added multi-line popups to markers and geojson/kml
174
175 = 2.8.1 =
176 * Code cleanup
177 * Added server-side and client-side methods to prevent WordPress from adding paragraph tags within shortcode tags
178
179 = 2.8.0 =
180 * Added Fit Markers to settings and map shortcode: [leaflet-map fit_markers=1]
181 * Moved geojson/kml popup text to the shortcode content instead of a property so that you can use links or other HTML
182
183 = 2.7.8 =
184 * update default Leaflet version (1.1.0 from 1.0.3)
185
186 = 2.7.7 =
187 * added default lat/lngs in the admin; and reordered admin fields to be more user friendly
188
189 = 2.7.6 =
190 * added optional cURL to get geolocations if file_get_contents is not allowed on a server (note: cURL needs to be enabled, obviously)
191
192 = 2.7.5 =
193 * fixed filter_var_array throwing errors in old PHP too
194
195 = 2.7.4 =
196 * Added settings link to plugins page
197
198 = 2.7.3 =
199 * Fix to array_filter on some PHP versions.
200
201 = 2.7.2 =
202 * Fix to possible JavaScript error "Unexpected token <"; only happened when a plugin/theme used `wpautop`; fix was to remove spaces.
203
204 = 2.7.1 =
205 * Removed unnecessary map counts;
206
207 = 2.7.0 =
208 * Added basic marker icon support (with attributes "iconUrl", "iconAnchor", etc.);
209
210 = 2.6.0 =
211 * Changes to map creation which may solve an occasional marker creation JavaScript error
212 * Added more attributes to marker shortcode (draggable, title, alt, opacity)
213 * 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
214
215 = 2.5.0 =
216 * Some improvements to the codebase;
217 * added the same styling options for lines as there are for geojson;
218 * added popups to lines, as there are for markers;
219 * added an example to the shortcode admin page for the style attributes on lines;
220 * added code and another example for disabling all map interactions (all zooms, keyboard, etc);
221
222 = 2.4.0 =
223 * Added Leaflet 1.0.2 scripts by default (works!);
224
225 = 2.3.0 =
226 * Added KML support `[leaflet-kml]`;
227
228 = 2.2.0 =
229 * Added popup_text and popup_property to leaflet-geojson to bind popups via a shortcode property or geojson properties
230
231 = 2.1.0 =
232 * Added Leaflet and GeoJSON.io styles to geojson shortcode
233
234 = 2.0.2 =
235 * OpenStreetMap.org has an SSL certificate (osm.org didn't); not a significant upgrade.
236
237 = 2.0.1 =
238 * Changed ajax request to be compatible with some versions of IE.
239
240 = 2.0 =
241 * 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!
242
243 = 1.16 =
244 * Added bare geojson support
245
246 = 1.15 =
247 * Removed shortcode brackets from leaflet-marker shortcode
248
249 = 1.14 =
250 * Fixed slashes in optional map attribution
251
252 = 1.13 =
253 * Added new geocoder options (thanks to [@nielsalstrup](https://github.com/nielsalstrup) for DAWA and [@jeromelebleu](https://github.com/nielsalstrup) for OSM)
254
255 = 1.12 =
256 * 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))
257
258 = 1.11 =
259 * Added HTTPS support.
260
261 = 1.10 =
262 * Added lines to the map, thanks to [@Remigr](https://github.com/Remigr)!
263
264 = 1.9 =
265 * Added ability to use hyperlinks in marker messages.
266
267 = 1.8 =
268 * Added ability to self-host leaflet files.
269
270 = 1.7 =
271 * Uploaded 1.6 to subversion incorrectly!
272
273 = 1.6 =
274 * Important fix to conflicts with other plugins!
275
276 = 1.5 =
277 * Some helpful js fixes for multiple window onload functions, and added the `leaflet-image` shortcode!
278
279 = 1.4 =
280 * Some fixes for Google geocoding, and switched cookies to db options.
281
282 = 1.3 =
283 * Added cookies for Google geocoding to cut back on requests.
284
285 = 1.2 =
286 * Added geocoding to map: `[leaflet-map address="halifax, ns"]`.
287
288 = 1.1 =
289 * Added messages to markers.
290
291 = 1.0 =
292 * First Version. Basic map creation and marker creation.
293
294 == Upgrade Notice ==
295
296 = 2.10.1 =
297 Fix for plugin settings not being included (somehow)
298
299 = 2.9.1 =
300 Fix for PHP7.2; added minified JavaScript files
301
302 = 2.8.6 =
303 Added [leaflet-gpx] for GPX format
304
305 = 2.8.6 =
306 Fix image shortcode ratio
307
308 = 2.8.5 =
309 Fix to missing files in 2.8.4
310
311 = 2.8.4 =
312 Fixed issues with css and js CDN; removed version from querystring
313
314 = 2.8.3 =
315 Fixed issues with leaflet-kml
316
317 = 2.8.2 =
318 Fixed issues with image maps and geocoder addresses
319
320 = 2.7.6 =
321 added optional cURL to get geolocations if file_get_contents is not allowed on a server (cURL needs to be enabled, obviously)
322
323 = 2.7.5 =
324 fixed filter_var_array throwing errors in old PHP
325
326 = 2.7.3 =
327 Fixed array_filter on some older PHP versions
328
329 = 2.7.2 =
330 Fixed possible JavaScript error "Unexpected token <"; fix was to remove spaces
331
332 = 2.6.0 =
333 Changes to map creation which may solve an occasional marker creation JavaScript error
334
335 = 2.0.2 =
336 OpenStreetMap.org has an SSL certificate (osm.org didn't)
337
338 = 2.0.1 =
339 GeoJSON ajax requests now work with Internet Explorer (some versions)
340
341 = 2.0 =
342 MapQuest tiles will no longer work without an app key!
343
344 = 1.15 =
345 Fixed incompatibility with plugins that execute recursive shortcodes
346
347 = 1.14 =
348 Fixed slashes in optional map attribution
349
350 = 1.12 =
351 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))
352
353 = 1.6 =
354 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).
355
356 = 1.5 =
357 Improved stability for multiple plugins with windows onload functions.
358
359 = 1.0 =
360 First Version. Tested with 3.8.1.