Include the following details (edit as applicable):
- Issue category: Lightship Maps / Semantic Segmentation / Multiplayer / Real-time Mapping-Depth / ARDK Documentation / Unity Example Package / Sample App aka ‘AR Voyage’ / ARDK Virtual Studio Tools / Developer Tools / Networking / VPS / Scanning Framework
- Device type & OS version: Android / iOS / Other Ex. iPhone 8+ on iOS 13
- Host machine & OS version: Mac / Windows / Linux / Other Ex. Mac on Big Sur x.x
- Issue Environment : Unity Remote / Unity Mock / On Device / Dev Portal
- Xcode version:
- ARDK version:
- Unity version:
Description of the issue:
Im making a university project that is a loction based game with an aim to teach about local area history. And I want to make a selfmade point in the map , and also give a label on it just like the google map.
And finally add some discription in it.
What more, I did try the way that Sample Projects | Niantic Lightship gave, but the layers from “building” can’t be used. There is nohing shown by “building”.
I think the teaching in the #labels-sample is not enouth at all.
Can you tell me more about the functions of making labels?
Hi Mr. Qao,
You’re right. There isn’t a lot of documentation on map labels. Labels work by leveraging the “Feature Builders” system for map themes (https://lightship.dev/docs/maps/unity/feature_builders/). Builders allow you to place prefabs at the location of particular features. For example, with a custom label prefab, you could add functionality to display additional information when a particular label is touched. Since you want to educate users of your app about certain local features, you would want to make a custom builder that only draws your custom labels at features that are at – or near – the coordinates of features you’re interested in. The
LightshipMapView class provides methods to convert a scene position to latitude and longitude coordinates and back again (https://lightship.dev/docs/maps/apiref/Niantic/Lightship/Maps/class_LightshipMapView/), useful for when you need to determine if you want to add a custom label at a particular location.
Where does the label information come from? Every feature on the map inherits from the
IMapTileFeature (https://lightship.dev/docs/maps/apiref/Niantic/Lightship/Maps/Core/Features/interface_IMapTileFeature/) interface which has an
ILabelInfo (https://lightship.dev/docs/maps/apiref/Niantic/Lightship/Maps/Core/Features/interface_ILabelInfo/) property which in turn provides the label information such as its positioning and text content.
I would recommend opening up the Feature Labels sample once more, and studying the TextMeshLabelBuilder, LabelBuilder, and ObjectBuilderStandard scripts to get an idea of how you would go about implementing your idea.