Skip to content

Instantly share code, notes, and snippets.

@oscarfonts
Last active February 23, 2017 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarfonts/265d734349396cf4372c to your computer and use it in GitHub Desktop.
Save oscarfonts/265d734349396cf4372c to your computer and use it in GitHub Desktop.
Map Widget Example
<html>
<head>
<title>Map Widget Example</title>
<script src="http://sensors.fonts.cat/js/SensorWidgets.js"></script>
<script>
SensorWidget('map', {
"service": "http://sensors.portdebarcelona.cat/sos/json",
"offering": "http://sensors.portdebarcelona.cat/def/weather/offerings#10m",
"features": [
"http://sensors.portdebarcelona.cat/def/weather/features#10",
"http://sensors.portdebarcelona.cat/def/weather/features#02"
],
"properties": [
"http://sensors.portdebarcelona.cat/def/weather/properties#30",
"http://sensors.portdebarcelona.cat/def/weather/properties#31"
],
"permanent_tooltips": "true",
"swap_axis": "true",
"popup_widget": {
"name": "timechart",
"title": "Temperatures",
"properties": [
"http://sensors.portdebarcelona.cat/def/weather/properties#32M",
"http://sensors.portdebarcelona.cat/def/weather/properties#32",
"http://sensors.portdebarcelona.cat/def/weather/properties#32N"
],
"time_start": "2015-09-03T05:05:40Z",
"time_end": "2015-09-03T08:05:40Z"
},
"max_initial_zoom": 14,
"base_layer": {
"type": "wms",
"url": "http://geoserveis.icc.cat/icc_mapesbase/wms/service",
"options": {
"layers": "orto5m",
"format": "image/jpeg",
"attribution": 'Ortofoto 1:5.000: CC-by <a href="http://www.icc.cat" target="_blank">Institut Cartogràfic de Catalunya</a>'
}
}
}, document.getElementById('map-container'));
</script>
</head>
<body>
<div id="map-container"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment