在页面中引用站点 css 时不显示 OpenLayers 2 多边形
OpenLayers 2 polygon not displayed when site css is referenced in the page
我正在使用 OpenLayers 2 使用以下代码在地图上绘制多边形。它是一个 angular 应用程序。
var style_local =
{ strokeColor: "#00FF00",
strokeOpacity: 0.6,
strokeWidth: defaultStrokeWidth,
fillColor: "#00FF00",
fillOpacity: defaultFillOpacity,
selectedColor: "#006500"
};
let pointList = ['-27.5311111111111', '18.2166666666667', '-21.5511111111111', '18.2155555555556', '-21.5497222222222', '13.1002777777778', '-16.8216666666667', '12.7702777777778', '-13.2761111111111', '12.7655555555556', '-13.2633333333333', '10.0522222222222', '-27.5147222222222', '10.0463888888889', '-27.5311111111111', '18.2166666666667'];
var points = new Array();
for (var i = 0; i < pointList.length; i += 2) {
console.log(pointList[i]);
console.log(pointList[i + 1]);
let point = new OpenLayers.Geometry.Point(pointList[i], pointList[i + 1]);
point.transform(this.projectionOfInput, this.projectionOfOutput);
points.push(point);
}
linearRing = new OpenLayers.Geometry.LinearRing(points);
let polygonFeature = new OpenLayers.Feature.Vector(
linearRing,
{ id: 123456,
center: points[points.length - 1],
code: "TestCode",
description: "TestDescription"
},
style_local);
this.featuresToLoad.push(polygonFeature);
this.kmlLayer = new OpenLayers.Layer.Vector("Coverage");
this.kmlLayer.addFeatures(this.featuresToLoad);
this.map.addLayer(this.kmlLayer);
行为是当我单击按钮时显示多边形。使用站点 css 文件时,多边形不显示。但是没有站点 css 多边形显示。 site.css 文件非常大,很难看出是什么覆盖了多边形填充样式。有什么想法吗?
svg {
max-width: unset !important;
}
站点 css 将 svg 最大宽度设置为 100%。用未设置覆盖它。
我正在使用 OpenLayers 2 使用以下代码在地图上绘制多边形。它是一个 angular 应用程序。
var style_local =
{ strokeColor: "#00FF00",
strokeOpacity: 0.6,
strokeWidth: defaultStrokeWidth,
fillColor: "#00FF00",
fillOpacity: defaultFillOpacity,
selectedColor: "#006500"
};
let pointList = ['-27.5311111111111', '18.2166666666667', '-21.5511111111111', '18.2155555555556', '-21.5497222222222', '13.1002777777778', '-16.8216666666667', '12.7702777777778', '-13.2761111111111', '12.7655555555556', '-13.2633333333333', '10.0522222222222', '-27.5147222222222', '10.0463888888889', '-27.5311111111111', '18.2166666666667'];
var points = new Array();
for (var i = 0; i < pointList.length; i += 2) {
console.log(pointList[i]);
console.log(pointList[i + 1]);
let point = new OpenLayers.Geometry.Point(pointList[i], pointList[i + 1]);
point.transform(this.projectionOfInput, this.projectionOfOutput);
points.push(point);
}
linearRing = new OpenLayers.Geometry.LinearRing(points);
let polygonFeature = new OpenLayers.Feature.Vector(
linearRing,
{ id: 123456,
center: points[points.length - 1],
code: "TestCode",
description: "TestDescription"
},
style_local);
this.featuresToLoad.push(polygonFeature);
this.kmlLayer = new OpenLayers.Layer.Vector("Coverage");
this.kmlLayer.addFeatures(this.featuresToLoad);
this.map.addLayer(this.kmlLayer);
行为是当我单击按钮时显示多边形。使用站点 css 文件时,多边形不显示。但是没有站点 css 多边形显示。 site.css 文件非常大,很难看出是什么覆盖了多边形填充样式。有什么想法吗?
svg {
max-width: unset !important;
}
站点 css 将 svg 最大宽度设置为 100%。用未设置覆盖它。