在页面中引用站点CSS时,未显示openlayers 2多边形



我正在使用openlayers 2使用以下代码在地图上绘制多边形。它是一个角度应用。

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,多边形显示。COSS.CSS文件非常大,很难看到什么是多边形填充样式。有什么想法吗?

svg {
     max-width: unset !important;
}

站点CSS将SVG最大宽度设置为100%。用未设置覆盖它。

最新更新