Hi list,
I encountered a strange behavior I don't understand: Sometimes I want to cover
my whole world map with a dark layer except a distinct region. This is meant to
emphasize a certain region of the world. My approach is creating a polygon
with the size of the earth and a hole with the region of interest. Looks like
this:
> var world = new OpenLayers.Geometry.LinearRing([new
> OpenLayers.Geometry.Point(-20037508.34, -20037508.34), new
> OpenLayers.Geometry.Point(-20037508.34, 20037508.34), new
> OpenLayers.Geometry.Point(20037508.34, 20037508.34), new
> OpenLayers.Geometry.Point(20037508.34, -20037508.34)]);
> var hole = new OpenLayers.Geometry.LinearRing([new
> OpenLayers.Geometry.Point(r.x1, r.y1), new OpenLayers.Geometry.Point(r.x1,
> r.y2), new OpenLayers.Geometry.Point(r.x2, r.y2), new
> OpenLayers.Geometry.Point(r.x2, r.y1)]);
> var geo = new OpenLayers.Geometry.Polygon([world,
> hole]);
>
> this.ftr = new OpenLayers.Feature.Vector(geo, null,
> {fill: '#000000'});
> layer.addFeatures([this.ftr]);
Everything is black except the region, perfect! But after zooming in, the
feature always disappears after a certain zoom level. Maybe the feature is too
big?
Do you have an explanation, a solution or a better approach for this
requirement?
Cheers,
Christoph
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users