Add a function to a map tip
Good morning,
I am working on a site that will display traffic camera photos. The traffic camera's photo will appear in the map tip when the traffic camera icon is clicked on on the map.
The photo is updated every 5-10 minutes (external website).
What I'm finding is that once the map tip is activated, the photo never updates. I need to refresh the entire map to get the most current photos to appear.
There is "startRefresh()" function that works in an html page outside of Geocortex. Is there any way to incorporate this code into the feature description / map tip so that the photo is automatically refreshed?
I tried adding the code to the feature description but it didn't like the function; the '{' brackets caused issues.
Thanks,
Allison
acharko@citywindsor.ca
0
-
I've never done this, but it seems like an interesting problem. Have you tried adding a dummy query clause behind the filename? This stack article (https://stackoverflow.com/questions/728616/disable-cache-for-some-images) describes the process; to steal an example: "<img src="image.png" /> would become <img src="image.png?dummy=8484744" />". Adding the query string prevents browser cache, which I suspect is your issue. 0 -
Hi Zack,
Thanks for your reply.
Seems like if I supply a randomly generated number to the end of the URL, republish the service (the URL is stored in a related table), and close and open the map tip, the photo updates!
I don't know if this solution will be feasible for us, but good to know that it could work!
I'm still interested in seeing if I can somehow get the map tip to refresh at a certain interval. If I figure anything out, I'll be sure to post it!
Thanks for your help!!
Allison0 -
If you're trying to put script into Map Tips, you're going to have a bad time. You'll need to make customizations to the viewer in order to allow for that. You could put an iframe in there though, which may give you the leeway needed to accomplish what you want without needing to mess with Geocortex itself. 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare