# Map marker in perspective

**URL:** <https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 12, 2024, 7:02am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276 "2024-05-12T07:02:36Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 20, 2024, 4:12pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/16 "2024-05-20T16:12:59Z")

</div>

Your vehicle data structure is different to the original post. We need to modify:

> **Map - custom.vehicleStatus**
>
> ```python
> [
> {
> "latitude": 42.472783,
> "longitude": -2.40938,
> "name": "05-RIO-MENDA"
> },
> {
> "latitude": 42.789632,
> "longitude": -1.639813,
> "name": "05-NAV-CORDO"
> },
> {
> "latitude": 41.624986,
> "longitude": -4.735528,
> "name": "05-CAL-FORJA"
> },
> {
> "latitude": 40.96796,
> "longitude": -5.661133,
> "name": "05-CAL-RINCO"
> }
> ]
> 
> ```

> **Map - custom.sampleMarker**
>
> ```python
> {
> "enabled": true,
> "event": {
> "stopPropagation": false
> },
> "icon": {
> "color": "#4190F7",
> "path": "material/location_on",
> "rotate": 0,
> "size": {
> "height": 36,
> "width": 36
> },
> "style": {
> "classes": ""
> }
> },
> "lat": 25.938225,
> "lng": 49.938877,
> "name": "marker0",
> "opacity": 1,
> "popup": {
> "autoClose": true,
> "closeButton": true,
> "closeOnClick": null,
> "closeOnEscapeKey": true,
> "content": {
> "text": "",
> "view": {
> "params": {},
> "path": ""
> }
> },
> "enabled": false,
> "height": {
> "max": null
> },
> "pan": {
> "auto": true
> },
> "width": {
> "max": 300,
> "min": 50
> }
> },
> "properties": {},
> "tooltip": {
> "content": {
> "text": "5956 XJR",
> "view": {
> "params": {},
> "path": ""
> }
> },
> "direction": "auto",
> "opacity": 1,
> "permanent": false,
> "sticky": false
> }
> }
> 
> ```

> **Map - script transform on ui.marker property binding**
>
> ```python
> def transform(self, value, quality, timestamp):
> 
> def recursiveCopy(original):
> # With credit to https://forum.inductiveautomation.com/u/lrose
> # https://forum.inductiveautomation.com/t/copy-dictionary-and-modify-it-without-affecting-the-original/62297/9
> from copy import deepcopy
> from com.inductiveautomation.ignition.common.script.abc import AbstractMutableJythonMap,AbstractMutableJythonSequence
> 	
> if isinstance(original,AbstractMutableJythonMap):
> return {key:recursiveCopy(value) for key,value in original.iteritems()}
> 	
> if isinstance(original,AbstractMutableJythonSequence):
> return [recursiveCopy(item) for item in original]
> 	
> return deepcopy(original)
> 	
> markers = []
> for car in value:
> protoMarker = recursiveCopy(self.custom.sampleMarker)
> protoMarker['lat'] = car['latitude']
> protoMarker['lng'] = car['longitude']
> protoMarker['tooltip']['content']['text'] = car['name']
> markers.append(protoMarker)
> return markers
> 
> ```

 ![Map.props.layers.ui.marker](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/5/d5190ade8617998e6795635e8b7d23714b47e1ac.png)

_Figure 4._

 ![Map spain](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/274a1cd8c9f7a41dde49382142323f90291fc861.png)

_Figure 5._

---

_[View the full topic](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276)._
