diff --git a/README.md b/README.md index 1c80f93..dae7b79 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,22 @@ Normally, displaying data as longitude, latitude will cause a cartographer to cr Disclaimer: Displaying data in spherical mercator might also cause a cartographer to cry. -`show()` allows you to specify different tile layer URLs, CRS/EPSG codes, output files, etc. +#### Map Styles +`show(tiles='STRING')` allows you to specify different tile layer URLs, CRS/EPSG codes, output files, etc. + +Predefind tile servers are: + * osm + * osm_german + * osm_france + * mapquest open + * mapbox bright + * thunderforest_landscape + * esri_aerial + * stamen_wc + * stamen_toner + * esri_natgeo + * cartodb_positron + * esri_worldtopo ### IPython Notebook embedding Just use `mplleaflet.display()` to embed the interactive Leaflet map in an IPython notebook. diff --git a/examples/readme_example.html b/examples/readme_example.html index 0e29653..d3b3c6e 100644 --- a/examples/readme_example.html +++ b/examples/readme_example.html @@ -1,3 +1,5 @@ + + @@ -5,7 +7,7 @@ #map0 { height:100%; } - +
@@ -20,9 +22,9 @@ return feature.properties; }, pointToLayer: function (feature, latlng) { - var icon = L.divIcon({'html': feature.properties.html, - iconAnchor: [feature.properties.width / 2.0 , - feature.properties.height / 2.0], + var icon = L.divIcon({'html': feature.properties.html, + iconAnchor: [feature.properties.width / 2.0 , + feature.properties.height / 2.0], className: 'empty'}); // What can I do about empty? return L.marker(latlng, {icon: icon}); } @@ -31,4 +33,5 @@ map.fitBounds(gj.getBounds()); - \ No newline at end of file + + \ No newline at end of file diff --git a/mplleaflet/maptiles.py b/mplleaflet/maptiles.py index 5234b03..0035e09 100644 --- a/mplleaflet/maptiles.py +++ b/mplleaflet/maptiles.py @@ -3,6 +3,16 @@ 'Map data (c) OpenStreetMap contributors' ) +osm_german = ( + 'http://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png', + 'Map data (c) OpenStreetMap contributors' +) + +osm_france = ( + 'http://{s}.tile.openstreetmap.fr/osmfr/${z}/${x}/${y}.png', + 'Map data (c) OpenStreetMap contributors' +) + mapquest_open = ( 'http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', 'Map tiles by MapQuest Data by OpenStreetMap, under CC BY SA.' @@ -53,6 +63,8 @@ tiles = { 'osm': osm, + 'osm_german': osm_german, + 'osm_france': osm_france, 'mapquest open': mapquest_open, 'mapbox bright': mapbox_bright, 'thunderforest_landscape': thunderforest_landscape,