Commit 679f0ee7 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Leaflet updated to v1

parent 2ed7834e
......@@ -29,6 +29,10 @@
}
}
.leaflet-sidebar .close {
z-index: 1000;
}
/*
* Buttons
*/
......
......@@ -170,6 +170,7 @@
border: 1px solid #173878;
padding: 2px 4px;
text-align: left;
color: white;
}
.side-content-feature-tags table tr th {
......
......@@ -83,21 +83,21 @@ var Main = function(divId, mode, config) {
{
"name": "OpenStreetMap",
"URL": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": "Tiles <a href=\"http://openstreetmap.org/\">OSM</a>",
"attribution": "<a href=\"http://openstreetmap.org/\">OSM</a>",
"minZoom": 1,
"maxZoom": 19
},
{
"name": "OpenStreetMap FR",
"URL": "http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png",
"attribution": "Tiles <a href=\"http://tile.openstreetmap.fr/\">OSMFR</a>",
"attribution": "<a href=\"http://tile.openstreetmap.fr/\">OSMFR</a>",
"minZoom": 1,
"maxZoom": 20
},
{
"name": "Stamen Toner",
"URL": "http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png",
"attribution": "Tiles <a href=\"http://maps.stamen.com/\">Stamen Toner</a>",
"attribution": "<a href=\"http://maps.stamen.com/\">Stamen Toner</a>",
"minZoom": 1,
"maxZoom": 20
},
......@@ -111,14 +111,14 @@ var Main = function(divId, mode, config) {
{
"name": "ÖPNV",
"URL": "http://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png",
"attribution": "Tiles <a href=\"http://www.öpnvkarte.de/\">ÖPNV</a>",
"attribution": "<a href=\"http://www.öpnvkarte.de/\">ÖPNV</a>",
"minZoom": 1,
"maxZoom": 18
},
{
"name": "OpenStreetMap DE",
"URL": "http://b.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png",
"attribution": "Tiles <a href=\"http://openstreetmap.de/karte.html\">OSMDE</a>",
"attribution": "<a href=\"http://openstreetmap.de/karte.html\">OSMDE</a>",
"minZoom": 1,
"maxZoom": 18,
"subdomains": "abcd"
......
......@@ -74,8 +74,13 @@ FeatureGeometry.prototype.getLabelPosition = function() {
}
else if(this.type == "Polygon" || this.type == "MultiPolygon") {
var coords = (this.type == "MultiPolygon") ? this.coordinates[0] : this.coordinates;
result = Polylabel(coords, 0.00001);
result = L.latLng(result[1], result[0]);
if(coords[0].length > 4) {
result = Polylabel(coords, 0.00001);
result = L.latLng(result[1], result[0]);
}
else {
result = this.getBoundsCenter();
}
}
else {
console.log("Unknown type: "+this.type);
......
......@@ -332,8 +332,8 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
var postProcessOSMFeatures = function() {
//Reorder layers according to options.layer value
var fLayers = this.layers.data.getLayers().sort(function(a, b) {
var layerA = (a.options != undefined) ? ((isNaN(parseFloat(a.options.layer))) ? 0 : parseFloat(a.options.layer)) : 0;
var layerB = (b.options != undefined) ? ((isNaN(parseFloat(b.options.layer))) ? 0 : parseFloat(b.options.layer)) : 0;
var layerA = (isNaN(parseFloat(a._olu_z_index))) ? 0 : parseFloat(a._olu_z_index);
var layerB = (isNaN(parseFloat(b._olu_z_index))) ? 0 : parseFloat(b._olu_z_index);
return layerA - layerB;
});
......
......@@ -145,7 +145,7 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
fLayerEdited = false;
fHasIcon = false;
// if(fid == "relation/5444317") {
// if(fid == "relation/5370005" || fid == "way/63904146") {
// console.log(feature);
// console.log(feature.style);
// }
......@@ -158,8 +158,6 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
fLayer.addLayer(
L.GeoJSON.geometryToLayer(
feature.asGeoJSON(),
null,
null,
{
weight: fStyle.width,
color: fStyle.color,
......@@ -172,8 +170,7 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
)
);
if(fStyle.z_index != undefined) {
if(fLayer.options == undefined) { fLayer.options = {}; }
fLayer.options.layer = fStyle.z_index;
fLayer._olu_z_index = fStyle.z_index;
}
fLayerEdited = true;
......
......@@ -55,7 +55,7 @@ Feature.prototype.get = function() {
if(this._feature != null) {
var title = $(
"<div class=\"side-content-feature-title\"><h2>"+this._displayName()+"</h2>"+
((this._feature.category != this._feature.name && this._feature.category != null) ? "<span>"+this._feature.category+"</span>" : "<span>"+this.t("feature.name")+"</span>")+
((this._feature.category != this._feature.name && this._feature.category != null) ? "<span>"+this._feature.category+"</span>" : "<span>"+this.t("features.name")+"</span>")+
"</div>"
);
element.append(title);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment