Compare commits
No commits in common. "c10f229f497a3520a7552ca068f1ce0b62ac818e" and "de3a4fc757104e6edb736bf4acb7fdb7c9259287" have entirely different histories.
c10f229f49
...
de3a4fc757
@ -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,8 +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 geojson = L.geoJSON(json, {
|
||||
var geojson = L.geoJSON(JSON.parse(xhttp_ps.responseText), {
|
||||
style: style,
|
||||
onEachFeature: onEachFeature,
|
||||
pointToLayer: pointToLayer
|
||||
@ -170,7 +146,7 @@ function load_geojson(name, url, iconname, iconcolor, active=1, style={}) {
|
||||
geojson.addTo(mymap);
|
||||
return geojson;
|
||||
} else {
|
||||
console.log("Error: Could not load geojson map layer (" + name + ").");
|
||||
alert("Error: Could not load geojson map layer (" + name + ").");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,7 +168,6 @@ load_geojson("CW Complexes", "./geojson/cw_complexes.json", "border-all", "black
|
||||
load_geojson("Courts", "./geojson/courts.json", "balance-scale", "black");
|
||||
load_geojson("Waterway", "./geojson/waterway.json", "water", "darkblue");
|
||||
load_geojson("Train Depots", "./geojson/depots.json", "wrench", "violet");
|
||||
load_geojson("Streets", "./geojson/streets.json", "street", "blue", 0);
|
||||
|
||||
L.control.scale().addTo(mymap);
|
||||
|
||||
|
@ -28,6 +28,7 @@ if (urlParams.has('editor')) {
|
||||
|
||||
function strToPoints(str) {
|
||||
var temp = JSON.parse("[" + str + "]"); // TODO: add .5 everwhere
|
||||
console.log(temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user