forked from openstreetmap/mod_tile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable ImageIO output format (openstreetmap#318)
* Added the possibility to provide ImageIO's output format in the TYPE string. For instance: TYPE=png image/png TYPE=png image/png png256 TYPE=png image/png png24 TYPE=png image/png png * Removed useless comments. Added documentation for output format. * Added tests for 'webp' output format * Also added tests for 'png32' output format * Fix 'webp' sums vary based on version * Add JPG & use multiple layers on example-map --------- Co-authored-by: Tim <[email protected]>
- Loading branch information
1 parent
2287afe
commit f652ab1
Showing
8 changed files
with
155 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<head> | ||
<title>renderd example map</title> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="icon" href="data:;base64,iVBORw0KGgo="> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="icon" href="data:;base64,iVBORw0KGgo=" /> | ||
<link rel="stylesheet" href="leaflet/leaflet.css" /> | ||
<script src="leaflet/leaflet.min.js"></script> | ||
</head> | ||
</head> | ||
|
||
<body style="margin: 0;"> | ||
<div id="map" style="position: absolute; width: 100%; height: 100%;"></div> | ||
<body style="margin: 0"> | ||
<div id="map" style="position: absolute; width: 100%; height: 100%"></div> | ||
|
||
<script> | ||
var map = L.map('map').setView([0, 0], 4); | ||
L.tileLayer('http://localhost:8081/tiles/renderd-example/{z}/{x}/{y}.png', { | ||
maxZoom: 12, | ||
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors.', | ||
}).addTo(map); | ||
</script> | ||
var attribution = | ||
'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors.'; | ||
var options = { | ||
maxZoom: 12, | ||
attribution: attribution, | ||
}; | ||
|
||
var png = L.tileLayer( | ||
"http://localhost:8081/tiles/renderd-example/{z}/{x}/{y}.png", | ||
options | ||
); | ||
|
||
var jpg = L.tileLayer( | ||
"http://localhost:8081/tiles/renderd-example-jpg/{z}/{x}/{y}.jpg", | ||
options | ||
); | ||
var png32 = L.tileLayer( | ||
"http://localhost:8081/tiles/renderd-example-png32/{z}/{x}/{y}.png", | ||
options | ||
); | ||
var webp = L.tileLayer( | ||
"http://localhost:8081/tiles/renderd-example-webp/{z}/{x}/{y}.webp", | ||
options | ||
); | ||
|
||
</body> | ||
var map = L.map("map", { | ||
center: [0, 0], | ||
zoom: 4, | ||
layers: [png], | ||
}); | ||
|
||
var baseMaps = { | ||
JPG: jpg, | ||
PNG: png, | ||
PNG32: png32, | ||
WEBP: webp, | ||
}; | ||
|
||
var layerControl = L.control.layers(baseMaps).addTo(map); | ||
</script> | ||
</body> | ||
</html> |