Socket
Book a DemoInstallSign in
Socket

geo-dashboard

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geo-dashboard

Web library to display data as maps and widgets using WMS, WFS and WPS services.

0.13.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

GeoDashboard Build Status

Web library to display data as maps and widgets using WMS, WFS and WPS services.

GeoDashboard is a pure client application. That means it doesn't include a backend side. All it needs to work is a map server with WMS, WFS and WPS enabled. At the moment, GeoDashboard has been tested only with GeoServer.

The idea behind this project is that anybody who already has an OGC compliant server up and running can create a simple and nice dashboard with just a few lines of JavaScript.

GeoDashboard has born as an inside project of SIASAR.

How to use it

There are basically two options to use GeoDashboard:

  • Downloading or linking the .js and .css files.
  • Installing the node package and requiring/importing it in your project.

Using the files

  • Include GeoDashboard CSS file
<link rel="stylesheet" href="https://unpkg.com/geo-dashboard/dist/geo-dashboard.css" />
  • Include GeoDashboard JS file
<script src="https://unpkg.com/geo-dashboard/dist/geo-dashboard.js"></script>

Using node package

  • Install the package
npm install --save geo-dashboard

or

yarn add geo-dashboard
  • Require or import the module
const GeoDashboard = require('geo-dashboard');

or

import * as GeoDashboard from 'geo-dashboard';

Next steps

  • Add a div where you wanna display the dashboard
<div id="dashboard"></div>
  • Create the dashboard
const dashboard = new GeoDashboard.Dashboard({
     container: document.getElementsById('dashboard'),
     header: {
       title: 'GeoDashboard Demo',
     },
     map: {
       center: [-75.01, -9.53],
       zoom: 7,
     }
});
  • Add some layers
dashboard.addBaseLayer(new GeoDashboard.OSMLayer({
     visible: true,
}));
dashboard.addOverlayLayer(new GeoDashboard.WFSLayer({
     title: 'Communities',
     server: 'https://geoserver.siasar.org/geoserver',
     layer: 'siasar:communities',
     visible: true,
     popup: [{
       title: 'Name',
       property: 'name',
     }],
     style: {
       property: 'score',
       values: {
         'A': { color: '#54BA46' },
         'B': { color: '#FFFF39' },
         'C': { color: '#FF9326' },
         'D': { color: '#C92429' },
       },
     }
}));
  • Add some widgets
dashboard.addWidget(new GeoDashboard.CountWidget({
     title: 'Total Communities',
     server: 'https://geoserver.siasar.org/geoserver',
     layer: 'siasar:communities',
}));
dashboard.addWidget(new GeoDashboard.AggregateWidget({
     title: 'Total Population',
     server: 'https://geoserver.siasar.org/geoserver',
     layer: 'siasar:communities',
     property: 'population',
     function: 'Sum',
}));
  • Call the render function
dashboard.render();
  • And... that's it! Go and navigate your new GeoDashboard.

Demo

Docs

For further details on objects, see the documentation.

FAQs

Package last updated on 10 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.