Skip to Content
0

sap.ui.vbm.AnalyticMap not able to change color of more than 100 regions

May 16 at 02:11 PM

24

avatar image

I am showing a world map. For this i want to change default color of all regions. Below is my code for the same. However, it is changing color of first 100 regions in the json only. Rest regions are appearing grey(default color).

Code:

<vbm:AnalyticMap id="vbi" width="97%" height="295px"
initialPosition="-98.5795;39.8283;2" regionClick="onRegionClick"
 zoomlevel="3"
regionContextMenu="onRegionContextMenu"
regions="{RegionModel>/}"
class="mapContainer sapUiSmallMargin">
                                            <vbm:regions>
<vbm:Region code="{RegionModel>code}" color="rgb(92,186,230)" tooltip="{RegionModel>name}" />
</vbm:regions>
....
</vbm:AnalyticMap
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sebastian Kielhorn May 16 at 02:42 PM
0

Hey Jyoti,

I just wrote an Blog article about this subject.
You have to increase the max Size of your binding because it is set to 100 by default.
In your case I would suggest something like this:

<vbm:AnalyticMap id="vbi" width="97%" height="295px"
initialPosition="-98.5795;39.8283;2" regionClick="onRegionClick"
 zoomlevel="3"
regionContextMenu="onRegionContextMenu"
regions="{path: 'RegionModel>/', length: 1000}"
class="mapContainer sapUiSmallMargin">
                                            <vbm:regions>
<vbm:Region code="{RegionModel>code}" color="rgb(92,186,230)" tooltip="{RegionModel>name}" />
</vbm:regions>
....
</vbm:AnalyticMap

There is another solution by setting default size Limit of your model but i wouldn't do cause it can lead to performance issues:

...
this.getView().getModel().setSizeLimit(1000);
...

Also if you're interested see my whole article here

Greetings,
Sebastian

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sebastian.

Thank you!! It worked after setting the length parameter.

0