Start a new topic

HTMLDrawable - Weather Widget

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.


Hi Team, Any update on this?

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

Login or Signup to post a comment