Create Multiple Circle | GisXchanger | QueryXchanger

I am trying to make many points in a map as a grid. The code makes what I expect but the time to load is quite long so I suppose that there should be other ways to be more efficient drawing many circles. The code used is the one below (the script). To squeeze out every little bit of your code, you should get rid of the main bottleneck, plus lower the redundancy, like here. The code can run under 200ms, which is very good compared to the original 500ms runtime. The main bottleneck is in the createCircle function. If you don't need every point to be present in a separate layer, you should pull the layer construction out of the function, as it will create a new layer on every iteration. There projection objects can also cause some redundancy. As they were declared and constructed in the beginning of the code, you should use them up. They can be used multiple times. Also, giving the center property to the map object, instead of calling setCenter grants a few ms boost to the code. Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: April 22, 2016 @ 3:11 am