summaryrefslogtreecommitdiff
path: root/htdocs/mapscript.js
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs/mapscript.js')
-rw-r--r--htdocs/mapscript.js29
1 files changed, 3 insertions, 26 deletions
diff --git a/htdocs/mapscript.js b/htdocs/mapscript.js
index 83967ba..d7ca17b 100644
--- a/htdocs/mapscript.js
+++ b/htdocs/mapscript.js
@@ -18,8 +18,8 @@ var streetLabelsRenderer = new L.StreetLabels({
// Projection fix from: https://gis.stackexchange.com/questions/200865/leaflet-crs-simple-custom-scale
var factorx = 1 / 256 * 4;
var factory = factorx;
-var originx = 7000;
-var originy = 7000;
+var originx = 7000 + 8 + 0.5;
+var originy = 7000 + 8 - 0.5;
var zoom_level_real = 6;
L.CRS.pr = L.extend({}, L.CRS.Simple, {
@@ -83,29 +83,6 @@ function load_svg(name, url, active=1) {
xhttp_ps.send();
}
-function json_center_on_block(json) {
- for (var i = 0; i < json.length; i++) {
- if (json[i].geometry && json[i].geometry.coordinates) {
- switch (json[i].geometry.type) {
- case "Point":
- json[i].geometry.coordinates[0] += 0.5;
- json[i].geometry.coordinates[1] += 0.5;
- break;
- case "LineString":
- for (var j = 0; j < json[i].geometry.coordinates.length; j++) {
- json[i].geometry.coordinates[j][0] += 0.5;
- json[i].geometry.coordinates[j][1] += 0.5;
- }
- break;
- default:
- console.log("centering: Type " + json[i].geometry.type + " not yet implemented.");
- break;
- }
- }
- }
- return json;
-}
-
function load_tiles(name, id) {
var satellite = L.tileLayer('https://notsyncing.net/maps.linux-forks.de/tiles/?id={id}&z={z}&x={x}&y={y}', {
maxZoom: 14 /*8*/,
@@ -159,7 +136,7 @@ function load_geojson(name, url, iconname, iconcolor, active=1, style={}) {
};
break;
}
- var json = json_center_on_block(JSON.parse(xhttp_ps.responseText));
+ var json = JSON.parse(xhttp_ps.responseText);
var geojson = L.geoJSON(json, {
style: style,
onEachFeature: onEachFeature,