[OpenLayers-Users] managing a large number of features

Altair bavrik at mail.ru
Sun Oct 25 13:02:30 EDT 2009


Thank you for your advice! I accept it for the future.
But I need to control the display of points depending on the scale, and now
I am inclined to use Vector Layer and OpenLayers.Rule (minScaleDenominator,
maxScaleDenominator). I should be experimenting. I would be grateful for
good advice:)


plen wrote:
> 
> Not sure if this may help in your situation but the first question is to
> see if you create your points like the following:
> 
> var pstyle = createPointStyle("browser_test_area/marina.png", 20, 20,
> true);
> var point1 = new OpenLayers.Geometry.Point(-42.45, -6.86);
> var pointFeature1 = new OpenLayers.Feature.Vector(point1,null,pstyle);
> getFeaturesLayer1().addFeatures([pointFeature1]);
> 
> where the features layer is a OpenLayers.Layer.Vector layer?
> 
> If so, and you don't care about some of the feature controls, like
> dragging, you can create your points using the following:
> 
> var iconSize =  new OpenLayers.Size(20,20);
> var iconOffset = new OpenLayers.Pixel(-((iconSize.w/2) - 3), -iconSize.h);
> var iconURL = "browser_test_area/intelligence.png";
> var marker = new OpenLayers.Marker(
>                new OpenLayers.LonLat("1.58", "7.82"),
>                new OpenLayers.Icon(iconURL,iconSize,iconOffset));
> getMarkersLayer().addMarker(marker);
> 
> where the markers layer is a OpenLayers.Layer.Markers layer.  Adding
> points to the map in this manner is MUCH, MUCH quicker.  You can still add
> event handlers like mouseclicks as well, but these done via the marker,
> not the layer.
> 
> - Peter
> 
> 
> 
> Altair wrote:
>> 
>> Hi all.
>> 
>> I have about 2000 points. When I add these points to the vector layer
>> over GeoJSON MultiPoint, map begins work very slowly.
>> Does OL points manager like MarkerManager in Google API ? Which show
>> points on the layer, depending on map zoom.
>> 
>> Thanks.
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/managing-a-large-number-of-features-tp3844771p3888111.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list