mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 09:15:29 +01:00
Merge remote-tracking branch 'upstream/master' into fix/issue-630
This commit is contained in:
commit
75ece350bd
1 changed files with 2 additions and 17 deletions
|
@ -58,23 +58,8 @@ class FeatureLayerPopup extends React.Component {
|
||||||
|
|
||||||
if(propName) {
|
if(propName) {
|
||||||
const propertySpec = latest["paint_"+feature.layer.type][propName];
|
const propertySpec = latest["paint_"+feature.layer.type][propName];
|
||||||
|
|
||||||
let color = feature.layer.paint[propName];
|
let color = feature.layer.paint[propName];
|
||||||
|
return String(color);
|
||||||
if(typeof(color) === "object") {
|
|
||||||
if(color.stops) {
|
|
||||||
color = styleFunction.convertFunction(color, propertySpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
const exprResult = expression.createExpression(color, propertySpec);
|
|
||||||
const val = exprResult.value.evaluate({
|
|
||||||
zoom: zoom
|
|
||||||
}, feature);
|
|
||||||
return val.toString();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Default color
|
// Default color
|
||||||
|
@ -84,7 +69,7 @@ class FeatureLayerPopup extends React.Component {
|
||||||
// This is quite complex, just incase there's an edgecase we're missing
|
// This is quite complex, just incase there's an edgecase we're missing
|
||||||
// always return black if we get an unexpected error.
|
// always return black if we get an unexpected error.
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error("Unable to get feature color, error:", err);
|
console.warn("Unable to get feature color, error:", err);
|
||||||
return "black";
|
return "black";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue