Commit 8892d5f1 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Fix for rendering of points (see #67)

parent 5b1964d6
......@@ -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();
......@@ -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;
}
......
......@@ -185,6 +185,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 +203,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');
}
......
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