Skip to Content

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

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 16 at 02:42 PM

    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

    Add comment
    10|10000 characters needed characters exceeded