Vision Map Component not painting tiles

I am building a tool in Vision that lists non active assets (data age > 15min) in a power table. Once this table is populated, the user can click a row to select an asset. On click, two things (are supposed to) happen. Firstly, the last reported latitude and longitude of the asset are written to a memory tag. This tag is used to facilitate a "Send to google maps" button that allows technicians to easily navigate to a non-reporting asset that they are potentially not familiar with. This functionality works fine. The second bit of functionality (the one that is giving me issues) is passing these coordinates into a sibling Map Component. This is done via the onMouseClick extension function of the power table.

latitude = float(self.data.getValueAt(rowIndex, 'Latitude'))

longitude = float(self.data.getValueAt(rowIndex, 'Longitude'))

name = str(self.data.getValueAt(rowIndex, 'assetname'))

zoom = 3
label = "'" + name + "'"
icon = "'MapPanel/lightblue.png'"
hover = "'MapPanel/shadow-pink.png'"

headers = ['Name', 'Latitude', 'Longitude', 'Label Expression', 'Icon Expression', 'Hover Expression']
data = [[name, latitude, longitude, label, icon, hover]]
dataset = system.dataset.toDataSet(headers,data)
self.parent.getComponent('Map Panel').dataPoints = dataset

system.tag.writeBlocking(['[default]ReliabilityTags/NonActiveDataset'],[dataset])
NAmap = self.parent.getComponent('Map Panel')
NAmap.setZoom(zoom)
NAmap.setGpsLocation(latitude, longitude)
NAmap.forceRedraw()

I am not super new to Ignition (~2yrs in Perspective), but I am very new to Vision, so I borrowed this code from another part of the project with similar functionality as I haven't found much in-depth information on the Vision Map Component. The strange thing is, it works on the other component, and it seems to work here as far as placing a pin on the map and centering the map on the pin at the appropriate zoom level. The issue I'm having is that the Painted-Tilescount stays at 0 on my map, and I wind up with a pin in the middle of a gray canvas. The other map (where I got the code) renders fine. I have ensured that all of the properties of my Map Component match the properties of the functional Map Component, but still no luck.

I feel like this is probably one of those simple things that I'm going to laugh at myself for once I find the solution, but for the time being, I'm stuck and dwelling on how easily I've accomplished similar functionality in Perspective at my previous gig. :joy:

TLDR: My Vision Map component isn't painting tiles, and I included a bunch of potentially unnecessary info on the chance that it is more necessary than I think.

The map component in Vision is provided by a third party module (Kymera Systems, possibly?) - you'll probably get more information about what the component expects from them.

I don't see anything obviously wrong with your script. You can also check the output console in the designer to see if there are any errors being thrown when this script runs.

Thank you, sir.

I'll look into Kymera and see if that's where it came from. I had a feeling it came from somewhere, but wasn't sure where to start looking. When I get it solved, I'll post solution here for posterity.

Again, educated guess, but yeah, it's probably Kymera:

It WAS Kymera. The fix was to add a layer and specify a tile server. Not sure if there is just no longer a default tile server or if there is and it is currently experiencing issues. In any case, an example fix for my use case using a Google server would be to add

NAmap.getTileServer().addLayer(1.0, "s", "google") #Earth Mode

prior to the re-draw.

Thanks for the quick response and pointing me in the right direction. It was definitely and easy fix once I had the documentation from Kymera.

1 Like