Integrating KML Layers with Google Maps

I am currently working on a project involving the integration of KML layers with Google Maps component within Perspective. I have some specific questions and am seeking guidance or additional documentation.

KML File Integration: Is the correct approach to integrate a KML layer to first save a KML file from Google Earth, then host it on the gateway using the Web Dev module? I have attempted this method but have not been successful. Are there specific steps or configurations I am missing?

URL Configuration: When integrating the KML layer, what is the correct format of the URL? Is it a direct link to the hosted KML file on the gateway? I would appreciate any examples or guidelines on how to correctly set this up.

Additional Documentation: I have searched the manual for “kml” but haven’t found extensive information. Are there other resources, examples, or documentation available that delve deeper into the integration of KML layers with Google Maps in Inductive Automation’s platform?

Any insights, suggestions, or references to additional resources would be greatly appreciated. I am particularly interested in any best practices or common pitfalls to avoid during this integration process.

Thank you for your assistance!

Hi Justin,

First we'll need to host the .kml file as a resource in the Webdev module which is documented here, and the URL formats for Webdev resources are documented here as well.

Once the file is hosted, you can reach it via URL from the Google Map component. Alternatively, we have a bit more information on utilizing JSON for kml's on map components documented over here, but this is specific to the Perspective Map Component.

You could even host a JSON that contains the URL to your Webdev hosted .kml file like in the non-Google map component example, and the rest of the JSON can contain the other .kml info the Google Map component is expecting:

image