# Add a Map feature prefab instance along the roads

**URL:** https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911
**Category:** I'm Stuck
**Tags:** feature-request, maps
**Created:** [October 10, 2023, 12:58am UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911 "2023-10-10T00:58:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@Ian](https://community.nianticspatial.com/u/Ian)
#### Post date: [October 10, 2023, 12:58am UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911/1 "2023-10-10T00:58:32Z")

</div>

Hi Niantic team,  
'Map-Based Resource" demo is helpful for understanding how to palce relavant objects based on MapLayer and Feature settings.  
Now I want to place 3d objects(ex: coins) along Roads(ex: path/pedestrian…), but can’t figure out how to do it. It looks only AreaObjectBuilder based features are allowed for building 3d objects at runtime.  
Please let me know if you have a description/sample for it, or if it can be added later.

---

<div class="post-metadata">

### Author: ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)
#### Post date: [October 17, 2023, 12:36am UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911/2 "2023-10-17T00:36:48Z")

</div>

Hey Ian,

Thanks for reaching out. I’m looking into this and I’ll get back to you as soon as I have some information for you!

---

<div class="post-metadata">

### Author: ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)
#### Post date: [October 18, 2023, 4:55pm UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911/3 "2023-10-18T16:55:30Z")

</div>

Hi Ian,

To get an idea of what you’d have to do to achieve this, you’ll want to take a look at the Map-Based Resource sample that you referenced.

Certain resources are spawned depending on the type of area so parks will spawn trees, parking areas will spawn stone, etc… In the sample, this is done in the MapFeaturePrefabSpawner which derives from AreaObjectBuilder.

In order to implement the spawning of coins on roads, you would have to implement your own custom AreaObjectBuilder but for Linear features rather than for area features

---

<div class="post-metadata">

### Author: ![Anshul\_Goyal](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Anshul\_Goyal](https://community.nianticspatial.com/u/Anshul_Goyal)
#### Post date: [April 8, 2025, 9:20am UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911/4 "2025-04-08T09:20:55Z")

</div>

Hey @Ian, were you able to get this map feature implementation done?

---

<div class="post-metadata">

### Author: ![Ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@Ian](https://community.nianticspatial.com/u/Ian)
#### Post date: [April 8, 2025, 7:04pm UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911/5 "2025-04-08T19:04:27Z")

</div>

It’s been a while with the project.  
Yes but with a limitation.

“~you would have to implement your own custom AreaObjectBuilder but for Linear features rather than for area features”

I can’t remember the detail, but had a custom AreaObjectBuilder class to place virtual items at random positions (not along the road). At that time, I referred a sample project planting(?) trees.. (Map-Based Resource sample).

---

<div class="post-metadata">

### Author: ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)
#### Post date: [March 5, 2026, 11:44pm UTC](https://community.nianticspatial.com/t/add-a-map-feature-prefab-instance-along-the-roads/3911/6 "2026-03-05T23:44:39Z")

</div>

Age
