# Dynamic map pin's color

**URL:** <https://community.weweb.io/t/dynamic-map-pins-color/9870>\
**Category:** How do I?\
**Tags:** design\
**Created:** [July 22, 2024, 2:33pm UTC](https://community.weweb.io/t/dynamic-map-pins-color/9870 "2024-07-22T14:33:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jptrinh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jptrinh/32/1493_2.png) [@jptrinh](https://community.weweb.io/u/jptrinh)\
**Post date:** [July 24, 2024, 8:36am UTC](https://community.weweb.io/t/dynamic-map-pins-color/9870/2 "2024-07-24T08:36:57Z")

</div>

Hey @Davy 👋

On your Google Maps settings, you have this Custom markers toggle. If you enable that, on your markers configuration, you’ll have a new Marker icon field. This field lets you pick a custom marker image.  
 ![CleanShot 2024-07-23 at 10.16.32](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/ce2a82af80cd933cd2d8873caf75d860f1b647b6.png)

 ![CleanShot 2024-07-23 at 10.16.39](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/8703778b870904f8eb92f1c4bc8ad3e7be1eb367.png)

Now, the remaining issue would be how to conditionnally pick the active pin or the inactive pin. I’m seeing 2 ways of doing that:

**In Xano (if your data is dynamic)**  
On your GET endpoint, you’ll want to return an additional key `isOpened`, that should have the value of a pin url depending on the opening hours. Basically in a function, you’ll want to check if the current hour is between the opening hours.

**In Weweb**  
You’ll want to modify your marker’s array to add the `isOpened` key to each object, and depending on the same condition, add the correct pin image url as a value.

Hope that helps!

---

_[View the full topic](https://community.weweb.io/t/dynamic-map-pins-color/9870)._
