Support for Wikitude Software Development Kit and tools is coming to an end. All the details can be found here. Kindly note that no new topics can be started on the forum from 21.09.2023. Also, some of the FAQs here (especially license related ones) might become inaccurate.
Hi,
We have created a weather widget which uses the HTML5 getLocation function to get the location of the user and display the current weather condition.
It is hosted on an external website.
We are trying to pass the URI of that to the HTMLDrawable of Wikitude, however there is a blank display.
We tried loading google.com on in the HTMLDrawable and it works fine, however the weather widget does not seem to be working.
Url for the weather widget:
https://hinduworld.co.in/weather.php
Source Code:
var weatherWidget = new AR.HtmlDrawable({ uri: "https://hinduworld.co.in/weather.php" }, 1, { viewportWidth: 750, viewportHeight: 450, backgroundColor: "#FFFFFF", offsetX: .5, offsetY: -1.5, horizontalAnchor: AR.CONST.HORIZONTAL_ANCHOR.RIGHT, verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP, clickThroughEnabled: true, allowDocumentLocationChanges: true, onDocumentLocationChanged: function onDocumentLocationChangedFn(uri) { AR.context.openInBrowser(uri); } });
Can you please let us know how to get this to work or if there is a workaround to get the user's current location and show the respective weather.
Please note that HTMLDrawables run in an isolated context and are not equipped with Wikitude's AR namespace. Commands like "AR.context.openInBrowser" therefore solely work in the "normal" WebView
Neelesh Pednekar
Hi,
We have created a weather widget which uses the HTML5 getLocation function to get the location of the user and display the current weather condition.
It is hosted on an external website.
We are trying to pass the URI of that to the HTMLDrawable of Wikitude, however there is a blank display.
We tried loading google.com on in the HTMLDrawable and it works fine, however the weather widget does not seem to be working.
Url for the weather widget:
https://hinduworld.co.in/weather.php
Source Code:
Can you please let us know how to get this to work or if there is a workaround to get the user's current location and show the respective weather.