How to draw multiple polygons on here map?

1.2k views Asked by At

I have problem when i try to draw more then one polygon on HERE map. If they are close to each other, they are not showing well. And behavior when zooming is very bad.

My approach was this:

map.objects.add(polygon1);
map.objects.add(polygon2);
map.objects.add(polygon3);

You can see bug on screenshot (all should be triangles with same color and opacity)

enter image description here

1

There are 1 answers

3
echom On

Assuming that you use the HERE Maps API v3 I don't think it should be map.objects.add. Looking at the API Playground example, I believe the correct way to do it is:

map.addObject(polygon1);
map.addObject(polygon2);
map.addObject(polygon3);

or:

map.addObjects([polygon1, polygon2, polygon3]);

API reference:

H.Map#addObject

H.Map#addObjects