![]() In any case, this seems to work by identifying the button ID that is clicked on and then directing it to the proper function. I don't know what you would call these, "document.getElementById(clicked_id).onclick = myFunction".expressions? Now that I think about it, why couldn't I reverse the myFunction and myFuntion2 so it looks more like a variable I'm familiar with.? Wait, those aren't variables because they don't say var in front of them. The way these functions and variables are written in JavaScript are very confusing coming from LiveCode. The above script is getting the button IDs when a user clicks on a button. Var myFunction = document.getElementById('1').addEventListener('click', function() ) ĭocument.getElementById(clicked_id).onclick = myFunctionĭocument.getElementById(clicked_id).onclick = myFunction2 I have attached a copy of the stack below.ī (1.76 KiB) Downloaded 289 timesĬlick the button to trigger a function that will trigger an answer dialog in LiveCode. You can click within any part of the browser widget, and it will trigger the answer dialog in LiveCode.Ĭould someone spell out for me what Javascript code I need to use in order to get the LiveCode handler to work when clicking the button? However, it suffers from the same problem as the panorama LiveCode project. So in an effort to make the problem as simplified as I can, I created a LiveCode project that has one button that triggers the javascript function, liveCode.myLiveCodeHandler, and triggers LiveCode to open and answer dialog window. I have not been able to figure out what JavaScript I need to use to limit this JS function to only the hotspot? First we give the button event listener, then inside it we fetch the data. The Albers projection (defined as albers in the Mapbox GL JS API) is a conic, equal-area projection. However, once the hotspot is clicked, any click within the browser widget triggers the handler in LiveCode. Next is the main part, we will fetch the data from the API and use the data we receive to display it in HTML. It took me a while, as I have almost no JS experience, but eventually I got a pano, created with a trial version of Pano2VR, to trigger the LiveCode handler via a hotspot within the panorama. 24#p145062 This was done with the Google Maps API and map markers. Open the Settings/Preferences in Pano2VR and add your key to the API field under the Advanced tab. Select the Maps JavaScript API, Places API, and Geocoding API. Under Key Restrictions, go to the API restrictions tab. That work was started after I saw a similar thing posted here. Open the Navigation menu, go to APIs & Services > Credentials. I'm in need of some JavaScript interventionĪ few weeks back I started toying with the idea of getting a hotspot in a panorama, which was sitting inside a browser widget, to communicate with LiveCode.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |