2017-06-04 10:26:25 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('select').material_select();
|
|
|
|
var mapChangeCommunity = function (event) {
|
|
|
|
var communityid = event.layer.feature.properties.community_id
|
|
|
|
location.href = 'firmware.php?id=' + communityid
|
|
|
|
}
|
2017-06-04 21:17:24 +00:00
|
|
|
var map = L.map('map').setView([50.75600670286445, 7.170810699462891], 9.5)
|
2017-06-04 10:26:25 +00:00
|
|
|
|
|
|
|
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/{style}/{z}/{x}/{y}.png', {
|
|
|
|
attribution: 'Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap-Mitwirkende</a>, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://carto.com/location-data-services/basemaps">Carto</a>',
|
|
|
|
maxZoom: 18,
|
|
|
|
style: 'light_all'
|
|
|
|
}).addTo(map);
|
|
|
|
communityiesGeoJson.forEach(function (i) {
|
|
|
|
$.getJSON( i.geojson, function( data ) {
|
|
|
|
var community = L.geoJSON(data, {
|
|
|
|
style: {
|
|
|
|
fillColor: "#dc0067",
|
|
|
|
fillOpacity: 0.25,
|
|
|
|
color: '#dc0067',
|
|
|
|
opacity: 1,
|
|
|
|
weight: 2
|
|
|
|
}
|
|
|
|
}).addTo(map)
|
|
|
|
community.on('click', mapChangeCommunity);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|