# 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:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibrahim\_abubakr](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@ibrahim\_abubakr](https://forum.inductiveautomation.com/u/ibrahim_abubakr)\
**Post date:** [May 12, 2024, 7:02am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/1 "2024-05-12T07:02:36Z")

</div>

Hi,

I am new to ignition, i want to use the Map component to place some moving vehicles, i have a lot of vehicles to show and it is time consuming to go and create the map marker for each car, the data source is from API, I did create a UDT for the vehicle and took instance from it for each car, I did some scripting to get the data from the API and put it in each car instance, now i want to put the markers on the map, i want to link the long, lat, and name in the tooltip to show it as a text above the marker

can you please share some detailed steps on how to do so as i dont have a lot of experience with ignition so far,

thanks

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/299d6f250ca2de091b1f2212fa2ca904de58a2bc.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/1/71cb45dfbd68a0efadee1c7755c2278507b86c2b.png)

---

<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 12, 2024, 8:51am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/2 "2024-05-12T08:51:25Z")

</div>

Welcome to the forum.

Please post a sample of your data for multiple cars so we know how to transform it. Post formatted data - not a picture of data so we don't have to type it all out again. See [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

---

<div class="post-metadata">

**Author:** ![ibrahim\_abubakr](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@ibrahim\_abubakr](https://forum.inductiveautomation.com/u/ibrahim_abubakr)\
**Post date:** [May 12, 2024, 8:56am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/3 "2024-05-12T08:56:03Z")

</div>

here

```python
{
  "name": "vehicles",
  "tagType": "Folder",
  "tags": [
    {
      "name": "9155 SJR",
      "typeId": "vehicle_1_template",
      "tagType": "UdtInstance",
      "tags": [
        {
          "value": 25.622837,
          "name": "Latitude",
          "tagType": "AtomicTag"
        },
        {
          "value": 49.548363,
          "name": "Longitude",
          "tagType": "AtomicTag"
        },
        {
          "value": "0",
          "name": "Speed",
          "tagType": "AtomicTag"
        },
        {
          "value": "2024-05-12T11:47:09",
          "name": "GPS_date",
          "tagType": "AtomicTag"
        },
        {
          "value": "95545.1",
          "name": "Mileage",
          "tagType": "AtomicTag"
        }
      ]
    },
    {
      "name": "5958 XJR",
      "typeId": "vehicle_1_template",
      "tagType": "UdtInstance",
      "tags": [
        {
          "value": "26",
          "name": "Speed",
          "tagType": "AtomicTag"
        },
        {
          "value": 26.230768,
          "name": "Latitude",
          "tagType": "AtomicTag"
        },
        {
          "value": 49.977375,
          "name": "Longitude",
          "tagType": "AtomicTag"
        },
        {
          "value": "2024-05-12T11:53:26",
          "name": "GPS_date",
          "tagType": "AtomicTag"
        },
        {
          "value": "103574.89",
          "name": "Mileage",
          "tagType": "AtomicTag"
        }
      ]
    },
    {
      "name": "5956 XJR",
      "typeId": "vehicle_1_template",
      "tagType": "UdtInstance",
      "tags": [
        {
          "value": "28",
          "name": "Speed",
          "tagType": "AtomicTag"
        },
        {
          "value": 25.938225,
          "name": "Latitude",
          "tagType": "AtomicTag"
        },
        {
          "value": "2024-05-12T11:53:23",
          "name": "GPS_date",
          "tagType": "AtomicTag"
        },
        {
          "value": 49.938877,
          "name": "Longitude",
          "tagType": "AtomicTag"
        },
        {
          "value": "130669.87",
          "name": "Mileage",
          "tagType": "AtomicTag"
        }
      ]
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![Ujwal\_Wankhede](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@Ujwal\_Wankhede](https://forum.inductiveautomation.com/u/Ujwal_Wankhede)\
**Post date:** [May 12, 2024, 12:33pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/4 "2024-05-12T12:33:54Z")

</div>

I think, a dataset type tag to render the data seems like a straightforward and logical approach. While there are multiple ways to implement this, here's a script that you can use  
Paste following binding on marker prop  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/f/4f37126edd46eff8588832988fb485af98a11cb0.png)

> **marker binding**
>
> ```python
> {
> "type": "expr",
> "config": {
> "expression": "now(60000)"
> },
> "transforms": [
> {
> "code": "\timport copy\n\t# Initialize default Marker JSON\n\tMarker_Dict \u003d {\n\t\t\"name\": \"\",\n\t\t\"properties\": {},\n\t\t\"enabled\": True,\n\t\t\"lat\": None,\n\t\t\"lng\": None,\n\t\t\"opacity\": 1,\n\t\t\"icon\": {\n\t\t\"path\": \"material/location_on\",\n\t\t\"color\": \"#4190F7\",\n\t\t\"rotate\": 0,\n\t\t\"size\": {\n\t\t \"width\": 36,\n\t\t \"height\": 36\n\t\t},\n\t\t\"style\": {\n\t\t \"classes\": \"\"\n\t\t}\n\t\t},\n\t\t\"event\": {\n\t\t\"stopPropagation\": False\n\t\t},\n\t\t\"tooltip\": {\n\t\t\"content\": {\n\t\t \"text\": \"\",\n\t\t \"view\": {\n\t\t \"path\": \"\",\n\t\t \"params\": {}\n\t\t }\n\t\t},\n\t\t\"direction\": \"auto\",\n\t\t\"permanent\": False,\n\t\t\"sticky\": False,\n\t\t\"opacity\": 1\n\t\t},\n\t\t\"popup\": {\n\t\t\"enabled\": False,\n\t\t\"content\": {\n\t\t \"text\": \"\",\n\t\t \"view\": {\n\t\t \"path\": \"\",\n\t\t \"params\": {}\n\t\t }\n\t\t},\n\t\t\"width\": {\n\t\t \"max\": 300,\n\t\t \"min\": 50\n\t\t},\n\t\t\"height\": {\n\t\t \"max\": None\n\t\t},\n\t\t\"pan\": {\n\t\t \"auto\": True\n\t\t},\n\t\t\"closeButton\": True,\n\t\t\"autoClose\": True,\n\t\t\"closeOnEscapeKey\": True,\n\t\t\"closeOnClick\": None\n\t\t}\n\t}\n\t\n\t# Read all the tags\n\tresults \u003d system.tag.browse(path \u003d \u0027[default]vehicles\u0027)\n\ttagPaths \u003d []\n\tfor result in results.getResults():\n\t\ttagPaths.append(str(result[\"fullPath\"]))\n\tvalues \u003d system.tag.readBlocking(tagPaths)\n\tvehicles \u003d []\n\tfor i in range(len(values)):\n\t\tvehicle_name \u003d tagPaths[i].split(\"/\")[1]\n\t\tvehicle_details \u003d values[i].value\n\t\tvehicles.append({vehicle_name:vehicle_details})\n\t# Add the custom marker instances\n\tMarker_Instances \u003d []\n\tfor vehicle in vehicles:\n\t\tname \u003d vehicle.keys()[0]\n\t\tMarker \u003d copy.deepcopy(Marker_Dict)\n\t\tMarker[\"lat\"] \u003d vehicle[name][\"Latitude\"]\n\t\tMarker[\"lng\"] \u003d vehicle[name][\"Longitude\"]\n\t\tMarker[\"tooltip\"][\"content\"][\"text\"] \u003d name\n\t\tMarker_Instances.append(Marker)\n\treturn Marker_Instances",
> "type": "script"
> }
> ]
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![ibrahim\_abubakr](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@ibrahim\_abubakr](https://forum.inductiveautomation.com/u/ibrahim_abubakr)\
**Post date:** [May 12, 2024, 12:56pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/5 "2024-05-12T12:56:14Z")

</div>

> [@Ujwal\_Wankhede](#):
>
> I think, a dataset type tag to render the data seems like a straightforward and logical approach.

can you clarify more on this part , and how to do it in your opinion,

---

<div class="post-metadata">

**Author:** ![Ujwal\_Wankhede](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@Ujwal\_Wankhede](https://forum.inductiveautomation.com/u/Ujwal_Wankhede)\
**Post date:** [May 12, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/6 "2024-05-12T13:26:17Z")

</div>

You are using a UDT to encapsulate all the data from a vehicle. Suggestion I have is to consolidate all the vehicles data within a dataset type tag, like the example below:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/3/437efe1a55687632450235610a8f54de52523276.jpeg)

Then you can use the tag as follow.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/7514275a6e0ed96063d1b5a0c382c88a1da36d9a.png)

I think it will be straightforward to build marker instances by iterating a dataset

---

<div class="post-metadata">

**Author:** ![ibrahim\_abubakr](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@ibrahim\_abubakr](https://forum.inductiveautomation.com/u/ibrahim_abubakr)\
**Post date:** [May 12, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/7 "2024-05-12T14:09:57Z")

</div>

thanks,

will try it

---

<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 12, 2024, 8:10pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/8 "2024-05-12T20:10:30Z")

</div>

I've never used the Map component but was interested in your question. Try this:

![Map markers 1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/279be61b4650c4dcba19d1631ac958cfdf617bfa.png)

_Figure 1._

1. Create two custom properties on the Map component:

- **vehicleStatus** and create a binding on this to your GPS data tags that you posted above.
- **sampleMarker**. Create the property and paste in a sample marker or the one below.

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

1. Create a property binding on `ui.marker` as shown below.  
 ![Map markers 2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/4/1401c2b877408cf70fedf0c64e02dcc8b29d3aab.png)

_Figure 2._

1. Paste in the following code:

> **ui.marker binding script transform**
>
> ```python
> 
> 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['tags']:
> protoMarker = recursiveCopy(self.custom.sampleMarker)
> name = car['name']
> for dic in car['tags']:
> if dic['name'] == 'Latitude':
> lat = dic['value']
> if dic['name'] == 'Longitude':
> lng = dic['value']
> protoMarker['lat'] = lat
> protoMarker['lng'] = lng
> protoMarker['tooltip']['content']['text'] = name
> markers.append(protoMarker)
> 	
> return markers
> 
> ```

How it works:

- The initial binding brings in `this.custom.vehicleStatus`. That gets passed to the script transform as **value**.
- We read in `self.custom.sampleMarker` as a template for constructing the list of markers. Due to the way Jython works we need to make a deepcopy of it (otherwise all the markers will be set to the last value). See the article referenced in the script to understand more.
- Loop through your GPS data and find the name, lat and lng of each vehicle. Note that dictionaries are unordered so we need a loop. Since your data will be short a simple loop is adequate and readable.
- Update the copy of the template and add it to the list of markers.

---

<div class="post-metadata">

**Author:** ![ignitionSL](https://avatars.discourse-cdn.com/v4/letter/i/9e8a1a/32.png) [@ignitionSL](https://forum.inductiveautomation.com/u/ignitionSL)\
**Post date:** [May 13, 2024, 4:49am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/9 "2024-05-13T04:49:40Z")

</div>

I suggest you to store vehicle information on a database then retrieve locations of the vehicle from the database via binding in to UI\> Maker.  
You can find the latest updated location of the vehicle via the database.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 20, 2024, 10:16am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/10 "2024-05-20T10:16:17Z")

</div>

> [@Transistor](#):
>
> ```python
> {
> "name": "marker0",
> "properties": {},
> "enabled": true,
> "lat": 25.938225,
> "lng": 49.938877,
> "opacity": 1,
> "icon": {
> "path": "material/location_on",
> "color": "#4190F7",
> "rotate": 0,
> "size": {
> "width": 36,
> "height": 36
> },
> "style": {
> "classes": ""
> }
> },
> "event": {
> "stopPropagation": false
> },
> "tooltip": {
> "content": {
> "text": "Vehicle ID",
> "view": {
> "path": "",
> "params": {}
> }
> },
> "direction": "auto",
> "permanent": false,
> "sticky": false,
> "opacity": 1
> },
> "popup": {
> "enabled": false,
> "content": {
> "text": "",
> "view": {
> "path": "",
> "params": {}
> }
> },
> "width": {
> "max": 300,
> "min": 50
> },
> "height": {
> "max": null
> },
> "pan": {
> "auto": true
> },
> "closeButton": true,
> "autoClose": true,
> "closeOnEscapeKey": true,
> "closeOnClick": null
> }
> }
> 
> ```

Thanks, I following instructions, I don´t understand where to past this after creating custom sampleMarker property, the only way I can do it is adding each value or object one by one

---

<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, 10:28am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/11 "2024-05-20T10:28:37Z")

</div>

![Map sample marker](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f06cccdb5821c2bcd073c1439ab95ba2af77bc6.gif)

_Figure 3._

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 20, 2024, 10:29am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/12 "2024-05-20T10:29:47Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 20, 2024, 1:22pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/13 "2024-05-20T13:22:24Z")

</div>

So to use this method with a simplified json as:

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

]

```

I would need to do a custom sampleMaker,

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6ab30d7039ee8662e128e49bb3b57ddcc82ebb28.png)

then bind it on my layers.ui.marker

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/0/80c1b0cca6e3b4083e86db2d9ee9a506a3b12001.png)

where should I put the Json ?:

and your code should be a Transform script from the bindin?

```python
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['tags']:
		protoMarker = recursiveCopy(self.custom.sampleMarker)
		name = car['name']
		for dic in car['tags']:
			if dic['name'] == 'Latitude':
				lat = dic['value']
			if dic['name'] == 'Longitude':
				lng = dic['value']
		protoMarker['lat'] = lat
		protoMarker['lng'] = lng
		protoMarker['tooltip']['content']['text'] = name
		markers.append(protoMarker)
	
	return markers

```

---

<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, 1:39pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/14 "2024-05-20T13:39:48Z")

</div>

> 1. So to use this method with a simplified json as:

Yes. That looks right.  
Put that JSON into `custom.vehicleStatus` (or whatever you call it).

> 1. I would need to do a custom sampleMaker,

Yes. It looks good.

> 1. then bind it on my layers.ui.marker ...

No. The script reads it in the line,  
`protoMarker = recursiveCopy(self.custom.sampleMarker)`  
There is no binding on `custom.sampleMarker`.

> 1. Where should I put the JSON?

I think I have answered this in 1 above.

> 1. ... and your code should be a Transform script from the binding?

See post #8, Figure 2.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 20, 2024, 1:49pm UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/15 "2024-05-20T13:49:50Z")

</div>

I don´t know how to put the Json into the vehicleStatus, with Property, Expression...?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/cc3eb8c8704c648e53de38154c9f0989f56ec3f1.png)

---

<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._

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 21, 2024, 7:26am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/17 "2024-05-21T07:26:08Z")

</div>

Thanks for the explanation Transistor, one thing I´m missing is t know where to paste the Json in the custom prop. I guess is a tag but I not sure how to do so.

---

<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 21, 2024, 8:37am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/18 "2024-05-21T08:37:59Z")

</div>

Which JSON and in which custom prop?  
The three code blocks above Figure 4 tell you where to paste them.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 21, 2024, 8:38am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/19 "2024-05-21T08:38:56Z")

</div>

> [@Transistor](#):
>
> ```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"
> }
> ]
> 
> ```

this part

---

<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 21, 2024, 8:42am UTC](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276/20 "2024-05-21T08:42:33Z")

</div>

It tells you!

![Vehicle status](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/521413de3b48a9437920f7d08e407bb6f30d1d23.png)

[Next page](https://forum.inductiveautomation.com/t/map-marker-in-perspective/90276.md?page=2)
