maybe someone can give me an advise how to handle this:
I created an Element/Symbol which can display a GoogleMap. I just entered a unique ID and used this ID to draw the GoogleMap within JavaScript and call the function after Layout/Element has been loaded - easy (using simply map = new google.maps.Map(hypeDocument.getElementByID("…"), myOptions)).
Now my problem. When I create a new Layout, the Element/Symbol must have a new unique ID and I cannot call the same JavaScript function, as it will paint the GoogleMap in the wrong Element/Symbol cause the new Element/Symbol has the new unique ID. I do not like to create e.g. seven functions using seven times the Element or Symbol.
I just played with document.getElementsByClassName(’…’) and using this function I can find all my Elements. Great.
One more question. I only want to display my GoogleMap in one Element - the active Element e.g. I defined three different layouts with the different position of my GoogleMap. How can I find out which is my “active” displayed Element?
nice one
well, i’d think you would either find out what event hype fires or simply check window.width() on load and resize to see which element would be affected / active …
another one: start a script on layoutload that finds the class within the layouts childelements, should then be only one