Please help me with webview and google map!

Dear all,
I follow this instruction:https://github.com/openhab/openhab/wiki/Samples-Tricks#how-to-display-google-maps-in-a-sitemap-from-a-mqttitude-mqtt-message.
Also I had modified the openhab.cfg file to config mqttitude binding.
On sitemap file, I wrote:
Webview url=“https://localhost:8443/static/map.html” height=12 because I saved the file called map.html under webapps/static folder
However on my openhab webpage, I received the error: The server refuse connection!
Any idea? Could you please help me out?
Thanks in advance!

Hi,

do you use OH 1.8.x, or 2.0.x?

Can you post your items configuration for the locations; do you see the coordinates there? How does the sitemap look like? Please note: those webviews will not work from android app & iOS app - @ least not for me in OH2. Thus please try if they show up in a web based UI.

kind regards,
Patrik

Thanks for your reply,
I am using OH 1.8.3.
My configuration doesn’t change much from this site: https://github.com/openhab/openhab/wiki/Samples-Tricks#how-to-display-google-maps-in-a-sitemap-from-a-mqttitude-mqtt-message

openhab.cfg:
MQTT configuration:

URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883

mqtt:mymosquitto.url=tcp://localhost:1883

Optional. Client id (max 23 chars) to use when connecting to the broker.

If not provided a default one is generated.

mqtt:mymosquitto.clientId=openhab

Optional. User id to authenticate with the broker.

mqtt:.user=

Optional. Password to authenticate with the broker.

#mqtt:.pwd=

Optional. Set the quality of service level for sending messages to this broker.

Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2

(Deliver exactly once). Defaults to 0.

#mqtt:.qos=

Optional. True or false. Defines if the broker should retain the messages sent to

it. Defaults to false.

mqtt:mymosquitto.retain=true

Optional. True or false. Defines if messages are published asynchronously or

synchronously. Defaults to true.

#mqtt:.async=

Optional. Defines the last will and testament that is sent when this client goes offline

Format: topic:message:qos:retained

#mqtt:.lwt=

MQTTitude Binding configuration:

Optional. The lat/lon coordinates of ‘home’

mqttitude:home.lat=xxx.xxxxx
mqttitude:home.lon=xxx.xxxxx

Optional. Distance in metres from ‘home’ to be considered ‘present’

mqttitude:geofence=100

Items:
String Location_Dan_Phone {mqtt="<[mymosquitto:owntracks/daniel/iphone5s:state:JS(mqttitude-coordinates.js)]"}

mqttitude-coordinates.js in the directory configuration/transform:
var location = eval(’(’ + input + ‘)’);
result = location.lat + “,” + location.lon;

the html file I stored in webapps/static (I named it map.html):

#map_canvas { width: 900px; height:500px; }

Now at last is my sitemap:
Webview url=“https://localhost:8443/static/map.html” height=12

Above is all of my configuration, I hope you can figure something whereas I am struggling with these!
Thanks you so much! I’m very appreciated!!

You’ve definitely got mqtt working? You can see the logs populating with location data?

You also definitely have mqqtitude installed? In addition to the MQTT binding?

Your map.html does not look anything like what it should be. Refer back to the example and see the full html example. Assuming it was just an error in copy/paste and you do have the html correct, then check the url address referred to inside the html file for good measure. This isn’t your problem, but might need editing if you haven’t done so already.

Your sitemap port matches the example of 8443, however mine is the default 8080. What exactly is yours?

thanks for your support, I found out the port wasn’t correct, mine is 8090, thanks you very much