Coder Social home page Coder Social logo

jwjulien / habpanel-map-widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ghys/habpanel-map-widget

0.0 0.0 0.0 79 KB

Map widget for HABPanel

Home Page: https://community.openhab.org/t/custom-widget-map/39225

License: MIT License

CSS 78.45% JavaScript 21.55%

habpanel-map-widget's Introduction

Map Widget for HABPanel

This widget will display a map from OpenStreetMap with up to 6 configurable markers positioned using openHAB Location items.

The marker will update in real time whenever the state of the underlying item changes. Clicking on a marker will reveal the label of the item in a tooltip.

Installation

Make sure the git command is available on your system, Clone this repository into your openHAB's html configuration folder:

$ cd /etc/openhab/html
$ git clone https://github.com/ghys/habpanel-map-widget

(the /etc/openhab/html is where the folder is on Linux package installations, change as necessary. See https://docs.openhab.org/installation/linux.html#file-locations).

Alternatively you can download a ZIP file of the repository contents and extract it into the habpanel-map-widget subfolder. Cloning the repository is the preferred option though, because you'll be able to update the widget's supporting files by pulling the latest changes (with git pull).

Use the widget gallery in HABPanel to access this repository (you might be reading this in it right now!) and click the big green Import Widget button.

Updating

If you used Git, go back to the html/habpanel-map-widget folder in your openHAB configuration where you cloned this repository, and pull the changes with Git:

$ git pull

Or, re-download the ZIP and overwrite the contents.

Next, go to the HABPanel custom widget list, open the widget's tile context menu, choose "Update..." and confirm.

You might need to go over the widget's settings on your dashboards again, or remove them and re-add them.

Configuration

The widget's configuration include a Center section, allowing to set the longitude, latitude and zoom level of the initial center of the map.

Use for instance https://www.openstreetmap.org/ to determine these parameters: search for a place, center and zoom the map as necessary, and check the URL in your browser's address bar, it will have this format:

https://www.openstreetmap.org/search?query=paris%2C%20france#map=12/48.8589/2.3469

Here you can see the zoom level is 12, the latitude is 48.8589, and the longitude is 2.3469.

The other sections are for the 6 possible markers, each with these options:

  • Enabled: click to enable the marker
  • openHAB item: choose an item holding the position of the marker - either a Location item or a String with the position in 'latitude,longitude' format
  • Marker icon: choose a Glyphicon to display: examples include user, tag, star. See the full list of available icons at https://getbootstrap.com/docs/3.3/components/
  • Marker color: the color of the marker

Acknowledgements

This widget includes the following libraries:

habpanel-map-widget's People

Contributors

ghys avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.