Commit 5341de4d authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Merge

parents a81d38dd e2f82041
......@@ -47,7 +47,11 @@
<!-- Init code -->
<script>
var myOlu = OLU.init("openlevelup", "advanced", {});
var myOlu = OLU.init("openlevelup", "advanced", {
"api": {
"overpass": "https://www.overpass-api.de/api/interpreter?data="
}
});
</script>
</body>
</html>
......@@ -47,7 +47,11 @@
<!-- Init code -->
<script>
var myOlu = OLU.init("openlevelup", "basic", {});
var myOlu = OLU.init("openlevelup", "basic", {
"api": {
"overpass": "https://www.overpass-api.de/api/interpreter?data="
}
});
</script>
</body>
</html>
......@@ -65,11 +65,11 @@ var Main = function(divId, mode, config) {
],
"api": {
"overpass": "http://www.overpass-api.de/api/interpreter?data=",
"overpass_alt": "http://api.openstreetmap.fr/oapi/interpreter/?data=",
"osm": "http://api.openstreetmap.org/api/0.6/",
"osm_dev": "http://api06.dev.openstreetmap.org/api/0.6/",
"nominatim": "http://nominatim.openstreetmap.org/",
"overpass": "https://www.overpass-api.de/api/interpreter?data=",
"overpass_alt": "https://api.openstreetmap.fr/oapi/interpreter/?data=",
"osm": "https://api.openstreetmap.org/api/0.6/",
"osm_dev": "https://api06.dev.openstreetmap.org/api/0.6/",
"nominatim": "https://nominatim.openstreetmap.org/",
"flickr": {
"url": "https://api.flickr.com/services/rest/?",
"key": "d06fb1ebb3ede5813b89c79320e11ab8"
......@@ -82,14 +82,14 @@ var Main = function(divId, mode, config) {
"tiles": [
{
"name": "OpenStreetMap",
"URL": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"URL": "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"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",
"URL": "https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png",
"attribution": "<a href=\"http://tile.openstreetmap.fr/\">OSMFR</a>",
"minZoom": 1,
"maxZoom": 20
......@@ -110,14 +110,14 @@ var Main = function(divId, mode, config) {
},
{
"name": "ÖPNV",
"URL": "http://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png",
"URL": "https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png",
"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",
"URL": "https://b.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png",
"attribution": "<a href=\"http://openstreetmap.de/karte.html\">OSMDE</a>",
"minZoom": 1,
"maxZoom": 18,
......
......@@ -61,7 +61,7 @@ OSM.prototype.download = function(bbox, success, fail) {
OSM.prototype.downloadLight = function(bbox, success, fail) {
this._requestOverpass(
bbox,
'(way["indoor"~"room|area|corridor|wall"];relation["indoor"~"room|area|corridor|wall"];way["buildingpart"~"room|verticalpassage|corridor"];relation["buildingpart"~"room|verticalpassage|corridor"];node[~"amenity|shop|railway|highway|door|entrance"~"."];way[~"amenity|shop|railway|highway|building:levels"~"."];relation[~"amenity|shop|railway|highway|building:levels"~"."];);out body;>;out skel qt;',
'(way["indoor"]["indoor"!="yes"];relation["indoor"]["indoor"!="yes"];way["buildingpart"~"room|verticalpassage|corridor"];relation["buildingpart"~"room|verticalpassage|corridor"];node[~"amenity|shop|railway|highway|door|entrance"~"."];way[~"amenity|shop|railway|highway|building:levels"~"."];relation[~"amenity|shop|railway|highway|building:levels"~"."];);out body;>;out skel qt;',
function(data) { success(this._process(data)); }.bind(this),
fail
);
......
......@@ -194,6 +194,10 @@ Feature.prototype.computeStyle = function(rules) {
),
18
);
if(this.id == "node/3701335527") {
console.log(this.style);
}
};
module.exports = Feature;
......@@ -129,7 +129,7 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
var feature, fid, fLayer, fStyle, fLayerEdited, fClickHandler;
var fLevel, fIconUrl, fIconCoords, fIconAngle, coord1, coord2;
var midSegment, fIconRgxTagName, fIconRgxTagValue, fTextOffset;
var fHasIcon, textVal;
var fHasIcon, textVal, fStyleProps;
var fIconRgx = /\$\[(\w+)\]/;
var locale = (window.navigator.userLanguage || window.navigator.language || "en").split("-")[0].toLowerCase();
......@@ -145,7 +145,7 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
fLayerEdited = false;
fHasIcon = false;
// if(fid == "relation/5370005" || fid == "way/63904146") {
// if(fid == "way/338795993") {
// console.log(feature);
// console.log(feature.style);
// }
......@@ -153,22 +153,32 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
/*
* Shape styles
*/
if(feature.style.shapeStyles.default != undefined && feature.geometry.type != "Point") {
if(feature.style.shapeStyles.default != undefined) { // && feature.geometry.type != "Point") {
fStyle = feature.style.shapeStyles.default;
fLayer.addLayer(
L.GeoJSON.geometryToLayer(
feature.asGeoJSON(),
{
weight: fStyle.width,
color: fStyle.color,
opacity: fStyle.opacity,
dashArray: fStyle.dashes,
lineCap: fStyle.linecap,
fillColor: fStyle.fill_color,
fillOpacity: fStyle.fill_opacity
}
)
);
fStyleProps = {
weight: fStyle.width,
color: fStyle.color,
opacity: fStyle.opacity,
dashArray: fStyle.dashes,
lineCap: fStyle.linecap,
fillColor: fStyle.fill_color,
fillOpacity: fStyle.fill_opacity
};
if(feature.geometry.type != "Point") {
fLayer.addLayer(
L.GeoJSON.geometryToLayer(
feature.asGeoJSON(),
fStyleProps
)
);
}
else {
fLayer.addLayer(
L.circleMarker(feature.geometry.getLabelPosition(), fStyleProps)
);
}
if(fStyle.z_index != undefined) {
fLayer._olu_z_index = fStyle.z_index;
}
......
......@@ -160,7 +160,17 @@ area[shop] {
fill-color: #E3F3F5;
opacity: 1;
fill-opacity: 1;
weight: 2;
width: 2;
z-index: -1;
}
/** Showcase **/
*[amenity=showcase] {
color: #A2CCC8;
fill-color: #A2CCC8;
opacity: 1;
fill-opacity: 1;
width: 2;
z-index: -1;
}
......@@ -177,12 +187,16 @@ area[shop] {
/** Historic elements **/
*[historic] {
text: name;
}
way[historic],
relation[type=multipolygon][historic] {
color: #C0B0A2;
opacity: 0.5;
width: 0.5;
fill-color: #C0B0A2;
z-index: -1;
text: name;
}
*[historic=tomb] {
......@@ -192,6 +206,13 @@ area[shop] {
icon-opacity: 1;
}
*[historic=artifact] {
icon-image: url('tourism_archaeological.png');
icon-width: 16;
icon-height: 16;
icon-opacity: 1;
}
/** Grass **/
area[landuse=grass],
relation[type=multipolygon][landuse=grass] {
......
......@@ -108,10 +108,11 @@ relation[type=multipolygon][room=technical]{
*/
/** Hard wall **/
area[indoor=~/room|wall/],
area[indoor=room],
area[buildingpart=~/room|hall/],
area[room],
*[indoor=column],
*[indoor=wall],
area[building],
area[building:part],
relation[type=multipolygon][indoor=~/room|corridor/],
......@@ -185,6 +186,10 @@ relation[type=multipolygon][laboratory]
*[door][door!=no],
*[entrance] {
icon-image: url('door.png');
}
way[door][door!=no],
way[entrance] {
color: #888888;
opacity: 1;
width: 2;
......@@ -199,10 +204,11 @@ relation[type=multipolygon][laboratory]
opacity: 1;
width: 3;
linecap: none;
icon-opacity: 0;
}
/** Entrance icons **/
*[entrance] {
*[entrance][entrance!=yes] {
icon-image: url('entrance_$[entrance].png');
}
......
......@@ -10,7 +10,7 @@ meta {
*/
/** All amenities **/
*[amenity] {
*[amenity][amenity!=showcase] {
fill-color: #FFDAAD;
opacity: 1;
fill-opacity: 1;
......@@ -140,3 +140,11 @@ meta {
icon-opacity: 1;
text: ref;
}
*[highway=milestone] {
icon-image: url('poi_point_of_interest.png');
icon-width: 16;
icon-height: 16;
icon-opacity: 1;
text: name;
}
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