All docschevron-rightUnity SDKchevron-rightarrow-leftExampleschevron-rightPOI placement

POI placement

The POI placement example makes it possible to find, add, and style points of interest (POIs) on a map. This example shows how to place custom prefabs over specific POIs.

POI placement

The POI Placement scene uses the POINTS OF INTEREST section in Abstract Map to place a variety of different markers at various POIs, organized by category.

Each layer includes a prefab and a set of rules for where to place the prefab. You can find POI locations by category (as in this example), by name ("Starbucks"), by address, or by latitude longitude coordinates. When finding POIs by category or name, it is also possible to adjust the density of results. For example, a high density of "Food" POIs will show all restaurants, cafes, and bars in an area, while a lower density will only show popular ones.

Customize POI prefabs

The Unity SDK comes with a few POI prefabs, which can be edited or replaced as needed. These prefabs all have PoiLabelTextSetter.cs attached to them to handle variable label sizes. This script first looks for the POI's name, house number, or type. It then uses that string as a label, and applies a color background to make it readable. This background adjusts to fit the size of the string, with extra padding along the sides.

It is possible hard code a specific label, or edit the script to change label attributes such as the background style. Note that these prefabs are all 2D sprites and TextMeshes that face the camera, but any style of prefab will work and PoiLabelTextSetter.cs does not necessarily have to be used.

Create a custom scene with POIs

The video tutorial below demonstrates how to approach adding POIs to a 3D map in a fly over scene.

Benefits and limitations

POI Placement allows you to add a variety of POI prefabs to a map, by category, name, address, or latitude and longitude. These prefabs can be 2D or 3D, though the scene uses 2D prefabs.

These POIs do not explicitly interact with the map and will not necessarily replace any vector features. Use this example to mark POIs on a map.

Was this example helpful?