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
Add a map generated with <ahref="http://www.leafletjs.com/"target="_blank">Leaflet JS</a>: a mobile friendly map application. Map tiles are provided by default through OpenStreetMap, or MapQuest (built-in support(?!) with an app key). Can be set per map with shortcode attributes or through the dashboard settings.
7
+
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.
Height, width, latitude, longitude and zoom are the basic attributes:
27
27
@@ -35,10 +35,16 @@ However, you can also just give it an address, and Google will look it up for yo
35
35
[leaflet-map address="Oslo, Norway"]
36
36
```
37
37
38
-
The default URL requires attribution by its terms of use. If you want to change the URL, you may remove the attribution. Also, you can set this per map in the shortcode (1 for enabled and 0 for disabled):
38
+
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):
39
39
40
40
```
41
-
[leaflet-map show_attr="1"]
41
+
[leaflet-map attribution=0]
42
+
```
43
+
44
+
OR
45
+
46
+
```
47
+
[leaflet-map attribution="Copyright @bozdoz"]
42
48
```
43
49
44
50
The zoom buttons can be large and annoying. Enable or disable per map in shortcode:
@@ -51,20 +57,20 @@ Alternatively, you could use a plain image for visitors to zoom and pan around w
51
57
52
58
### [leaflet-marker]
53
59
54
-

60
+

55
61
56
62
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 `[leaflet-marker]Message here: click here[/leaflet-marker]` and add a link like you normally would with the WordPress editor.
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.
64
70
65
71
### [leaflet-geojson]
66
72
67
-
[](https://gist.github.com/bozdoz/064a7101b95a324e8852fe9381ab9a18)
73
+
[](https://gist.github.com/bozdoz/064a7101b95a324e8852fe9381ab9a18)
68
74
69
75
Or you can add a geojson shape via a url:
70
76
@@ -78,14 +84,14 @@ Check it out [here](https://gist.github.com/bozdoz/064a7101b95a324e8852fe9381ab9
78
84
79
85
Same idea as geojson (above), but takes KML files and loads [Mapbox's togeojson library](https://github.com/mapbox/togeojson)
80
86
81
-
Pull Requests
87
+
Contributing
82
88
-------------
83
89
84
-
I believe the purpose of this plugin is to provide **simple** creation of maps on their WordPress sites, using a **basic** Leaflet JS setup. I **will not accept** pull requests that incorporate any other [Leaflet plugin](http://leafletjs.com/plugins.html) into this one, or any copies of them, or any links to them (unless they are completely simplistic and globally usable). Obviously I don't want to load dependencies for every user of this plugin that only a handful of users want.
85
-
86
-
Also, please keep your pull requests limited to one feature/improvement each, as a courtesy to me who has to look through it trying to figure out what does what (and if it works at all). Any number of bug fixes is completely acceptable. :)
0 commit comments