Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markers vs. Vector points - performance impact

Tags:

openlayers

I am starting a new Openlayers project and trying with few examples. If I have to load say 500 objects, is it better to load them as Markers or Vector points? These are going to be static elements on the map with label and popup. Would there be any difference in the performance between the two in terms of panning/zooming/loading etc? I know Markers might have certain limitations wrt styles etc., but so far I am able to achieve what I need to display with Markers.

I see in Openlayers faq that a max. of 500 markers is recommended and only 100-200 features (vector geometry points would come under this I assume) are recommended for better performance wrt panning/zooming. So I was under the impression markers are better in terms of performance. But everywhere the recommendation is to use Vectors and in the latest release 2.11, it doesn't support Markers by default, but we will need to include the Markers file seperately if we want to use them, which makes me wonder if this is going to be deprecated soon.

Thanks for any help, Aridbh.

like image 708
user731918 Avatar asked Nov 13 '22 17:11

user731918


1 Answers

I haven't done any tests on performance but taking a look at the source code for Markers and Vector layers I would suggest that Markers should be faster. While Markers are drawn on the map by simply appending images to the divs, Vector layer renders features using SVG or VML which should be slower.

I would anyway try Vector layer and see if it's performance is good enough in your situation since it's so much more flexible. There's a good chance you'll run into problems with event or z-index handling if you use Markers(from my own experience).

like image 176
igorti Avatar answered Feb 28 '23 13:02

igorti