You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__('If enabled, all markers on each map will alter the view of the map; i.e. the map will fit to the bounds of all of the markers on the map.', 'leaflet-map'),
However, you can also just give it an **address**, and Google (by default) will look it up for you:
27
+
Lookup an address with:
28
28
29
-
`[leaflet-map address="Oslo, Norway"]`
29
+
`[leaflet-map address="chicago"]`
30
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):
31
+
Know the latitude and longitude of a location? Use them (and a zoom level) with:
32
32
33
-
`[leaflet-map attribution=0]`
33
+
`[leaflet-map lat=44.67 lng=-63.61 zoom=5]`
34
34
35
-
OR
35
+
Add a **marker** under your map shortcode, like so:
36
36
37
-
`[leaflet-map attribution="Copyright @bozdoz"]`
37
+
`
38
+
[leaflet-map]
39
+
[leaflet-marker]
40
+
`
38
41
39
-
Look at other examples on the Shortcode Helper in the Leaflet Map admin section.
42
+
Want more? Make more (and fit the map to contain all of them):
40
43
41
-
= Markers =
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
+
`
42
51
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.
52
+
You can even add **popups** (to any shape) with their names:
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 =
46
64
47
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.
48
66
49
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]`.
50
68
51
-
Or you can add a geojson shape via a url (work in progress): `[leaflet-geojson src="https://example.com/path/to.geojson"]`
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)):
`name` is a property on that GeoJSON, and it can be accessed with curly brackets and the property name.
52
77
53
78
= Image Maps =
54
79
55
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.
56
81
57
-
Check out the source code on [GitHub](https://github.com/bozdoz/wp-plugin-leaflet-map)!
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)!
58
87
59
88
Shoot me a question [@bozdoz](https://www.twitter.com/bozdoz/).
60
89
@@ -126,6 +155,13 @@ Yes: use the keyword `attribution` in your shortcode (semi-colon separated list
126
155
127
156
== Changelog ==
128
157
158
+
= 2.12.0 =
159
+
* Re-added Google Geocoder (optional), since they forced billing accounts
160
+
* Fixed links in shortcode helper page
161
+
* Fixed issue with marker popups that had single quotes
162
+
* Loading leaflet scripts and styles only when a map shortcode is used
163
+
* Added fitbounds to leaflet-map (to replace fit_markers someday)
164
+
129
165
= 2.11.5 =
130
166
* Added assumed-boolean attributes to all shortcodes; ex: `[leaflet-marker draggable svg]` would be the same as `[leaflet-marker draggable=1 svg=1]`
131
167
@@ -302,6 +338,9 @@ Yes: use the keyword `attribution` in your shortcode (semi-colon separated list
302
338
303
339
== Upgrade Notice ==
304
340
341
+
= 2.12.0 =
342
+
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
343
+
305
344
= 2.11.4 =
306
345
Fix to a race condition issue with custom scripts changing leaflet rendering methods
0 commit comments