Guidesv3.2 API Referencev3.1 API Reference
Guides

Apply custom geopolitical views

 HERE Maps API for JavaScript version 3.2

By using the HERE Vector Tile API in conjunction with the HERE Maps API for JavaScript, you can present borders that are subject to varying viewpoints, allowing you to meet diverse user preferences and geopolitical considerations. Whether you want to emphasize borders based on international agreements or showcase them from the standpoint of a specific country, the HERE Vector Tile API enables you to create maps that faithfully represent disputed boundaries.

In the HERE Vector Tile API data model, disputed borders are encoded within the boundaries layer, through the kind:xx property, where xx represents the supported country code, reflecting the political standpoint of a particular country. For more information about the boundaries layer and the list of all supported geopolitical views, see the following documents:

By default, the HERE Maps API for JavaScript presents an international perspective by displaying disputed borders as dashed lines. The following figure illustrates this view in the context of Jammu and Kashmir, along with Ladakh, a region situated between Pakistan and India:

Jammu and Kashmir along with Ladakh - International view

Switch geopolitical views

📘

Note

The example in this section builds upon the base map described in Get started with HERE Maps API for JavaScript as the foundation for introducing code additions.

To switch the map display from the international perspective to a geopolitical view of a particular country, use the setPoliticalView() method of the H.service.omv.Provider class, as shown in the following example:

map.getBaseLayer().getProvider().setPoliticalView("in"); 
// change to "pk" for the Pakistani view on Kashmir

This code from the preceding example sets the geopolitical view of the map to the Indian one (in). Result: The following figure shows how HERE Maps API for JavaScript renders disputed borders, depending on the selected geopolitical view:

Geopolitical view examples for the Kashmir region