我正在从现有的 lonlats 中绘制多边形。但它以非常非常小的尺寸显示。代码如下,
for(var i in coordinates) {
point = new OpenLayers.Geometry.Point(coordinates.lon,coordinates.lat);
point.transform(new OpenLayers.projection("EPSG:4326"),map.getProjectionObject());
points.push(point);
}
points.push(points[0]);
var linearRing = new OpenLayers.Geometry.LinearRing(points);
var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,{strokeColor:"black",
fillColor:"orange",sides:4});
newLayer.addFeatures([polygonFeature]);
newLayer.redraw(true);
但它以非常非常小的尺寸显示。如何显示更大的尺寸?有什么帮助吗?