Google Earth is a super tool to discover earth but it only offers satellite imagery.
Online mapsources are consistent and mainly used in webpages, desktop clients and mobile apps so, why not in Google Earth?
KmlSuperOverlay is a simple PHP gateway that intends to meet this need :) Of course, it's not the unique one!I used geos for a long time - An excellent all-in-one standalone tool but as I'm not a 🐍 developer, I was not able to geek on it :(
Some "heavy" or complex WSGI server can also do that and some map providers, like caltopo, do it for a fee.See credits below for further informations.
French IGN topo over Écrins
Swiss hiking paths & Strava run heatmap over Arolla
You can use every online map server that doesn't require specific referer or a 2 steps authentication - only url tokens is now supported.
As you might know, there is no unique standard to request online tiles with some great complexity like the notorious EPSG!
KmlSuperOverlay support:
- Tiled Web Map (TMS / WMTS)
- Slippy Map (Standard)s
- Reverse Y
- Quad Tree
- Web Map Service (WMS)
- Pure & simple PHP. No dependencies or composer modules.
- Fast or low memory footprint - That's why I concatenate string rather than using simple_xml. Thanks not yelling at me ;)
- Based on Mobile Atlas Creator (mobac) and GEOS mapsource xml files.
-
PHP >= 8 (see #1 for PHP7)
-
- Will works with 2.0 or 2.2 just changing
Require
term in configuration
- Will works with 2.0 or 2.2 just changing
/kmlsuperoverlay
will be the "how-to" end-point example
LoadModule rewrite_module ./modules/mod_rewrite.so
...
<Location /kmlsuperoverlay >
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !index.php
RewriteRule ^(.*)$ index.php?qs=$1 [L,QSA]
</Location>
<Location /kmlsuperoverlay/mapsources >
Require all denied
</Location>
extension=tidy
extension=zip
// !! with ending '/'
define("MAP_SOURCE_ROOT","./mapsources/");
// !! with ending '/'
define("URL_BASE","/kmlsuperoverlay/");
💥it works!💥
All the "fine" tuning might be done with the static vars of KmlSuperOverlay
Class
worldBbox
: Default bounding box coordinates for region overlayedtidyOptions
: Operation made by Tidy (if enabled) to prettify kml formatkmlformat
: Header, footer and styles for the generated kml filelod
: Level Of Detail configuration for groundOverlay (tiles) and networklink (kml)- Values are automatically overridden in case of:
overlay == false OR current zoom value == mapsource maxZoom >> lod["groundOverlay"]["maxLodPixels"]
disabledcurrent zoom value == mapsource minZoom >> lod["groundOverlay"]["minLodPixels"] && lod["networkLink"]["minLodPixels"]
disabled- Current values are optimized for 256x256px tile size.
- Values are automatically overridden in case of:
altitude
: Limit tile displaying between certain altitude point of view (0 = no limitation)minZoom
: Set the minimum displayed zoom even if mapsource minZoom is lower than defineddisplayRegion
: Enable or disable the display of a green rectangle representing the region if defined in mapsource.debugHtml
: if set to true, display kml output in html for browser rendering onlyoutFormat
:.kml
or.kmz
. Default is.kml
- kmz need zip extension to be enabled and offer less bandwidth but more cpu usage
Just end url with /debug
, it's will set debug mode for all kml networklink.
Currently just dumping performance metrics on description element of the kml document.
Debug output can be html or kml (see above). kmz is disabled, even if it's set as the default output format.
You may have a look at Google kml superoverlays reference page to interpret kml output
☝️ If you are a mobac and/or geos user, you can simply define
MAP_SOURCE_ROOTs
as same as their map sources directory KmlSuperOverlay will only keep xml customMapSource - excludingxml
customMultiLayerMapSource andbsh
BeanShell Script see #305 issue on mobac for extra elements
I provided as an example few mapsources for each format and feature in ./mapsources
Please have a look on map providers general conditions of use before and see Resources to enlarge your collection ;)
-
Full documentation about
customMapSource
is available on geos website- described on mobac website might be used to set transparency (only last hex value is used)
-
transparent:
#FFFFFF
00
⚠️ Tile will not be visible- 50% transparency:
#FFFFFF
80
- 50% transparency:
-
opaque:
#FFFFFF
FF
(default) -
I added:
- described on mobac website
- not documented as it's actually specific:
Just addtrue
for tiles in PNG Alpha (transparency)
it will change Level Of Detail (lod) configuration to ensure that low zoomed tiles will not be visible and override the viewed ones
- Be sure to encode your
customMapSource
xml files in utf8, otherwise they'll not appear in your list if it contains accented char#frenchy
- @grst for geos - My main inspiration for this project.
- @r_x for mobac - A "must-have" tool for all GeekHiker like me ;)
- @Nicolas.Paour for randochartreuse - The "good maths" for coordinates transformation.
-
Other "SuperOverlay" tools
-
Map Servers list
- https://wiki.openstreetmap.org/wiki/Tile_servers
- https://josm.openstreetmap.de/wiki/Maps#Listofsources
- https://github.com/grst/mapsources
- https://en.wikipedia.org/wiki/List_of_online_map_services
- https://giswiki.hsr.ch/Hintergrundkarten
- http://randochartreuse.free.fr/mobac2.x/mapsources/
- https://dzjow.com/2012/04/12/free-online-topographic-maps-for-hiking/
- https://osmlab.github.io/editor-layer-index/
- https://www.randonner-leger.org/wiki/doku.php?id=cartographie_et_informations_pour_la_randonnee#cartes_glissantes_en_ligne
- https://github.com/Ecotrust/madrona/blob/master/madrona/layer_manager/utils/proc_layers.py
- https://projects.webvoss.de/2017/06/03/creating-the-perfect-hiking-map-for-germany-and-other-countries/
- http://www.f-bmpl.com/index.php/faites-le-vous-meme/210-3-listing-des-serveurs-ortos
- https://api.routeconverter.com/v1/mapservers/?format=xml
- https://www.camptocamp.org/articles/676486/fr/cartes-topographiques-en-ligne
- https://xyz.michelstuyts.be/
- http://www.vttour.fr/articles/read_35.html
- https://www.creazo.fr/listing-des-fonds-de-cartes-dopen-street-map/