Skip to main content

Map Add-In ability to create a modal

MobileObie-1715
Original Poster

Hey team,

I am working on a Map Add-In page that will not utilize the right side panel but will strictly use the actions when clicking on a Device on the map (based on the example here).

 

Instead of opening the right side panel with some content based on the selected action, I would like to open a modal in the center of the page. I attempted to retrieve the document object for the Map page by doing a

const documentObject = elt.ownerDocument;

But this will only retrieve the iframe:

{ "location": { "ancestorOrigins": { "0": "https://my.geotab.com" }, "href": "https://my.geotab.com/test/geotab/checkmate/maps/addins/frame/page/iframe.html", "origin": "https://my.geotab.com", "protocol": "https:", "host": "my.geotab.com", "hostname": "my.geotab.com", "port": "", "pathname": "/test/geotab/checkmate/maps/addins/frame/page/iframe.html", "search": "", "hash": "" } }

Any suggestions on how I can programmatically create a modal (dialog) for the Map page?

 

Thanks!

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

3 Replies

EishiFUN
Geotabber

Hello @MobileObie-1715​ ,

 

Thank you for asking your question in our community. I wanted to tag in a few of our Insiders and see if they can give you some advice here. What do you think @LPPapillon-1145​  or @TuckerBA-1087​ ?

 

If they are busy or unable to help I will contact one of our subject matter experts and have them look into this for us.

 

If you have any other questions in the meantime please reach out. We are happy to help.

 

Have a great day!

Eishi FUN

I don't believe this will be possible. Your add-in is being run in an iframe and thus doing this would be considered a cross-domain request, CORS rules apply. Maybe I'm wrong in the context if noView add-ins or if you upload your code to be hosted at Geotab, but for us working on "traditional" map add-ins, we found no way to directly interact with the parent document. This is why the supplied services are useful to get/pass data from/to the map page.

MobileObie-1715
Original Poster

@LPPapillon-1145​ thanks for your response! I was hoping to launch a dialog to allow for media access without being limited to the size of the right side panel OR opening a separate tab that may break the UX for users. Given the nature of the Map Add-In, I wasn't sure if the supplied service had a way to interface back to the main page.

 

I did see the following here that I will test with, though I was hoping something may have already been implement that wasn't in the developer guide

Still have questions?