Fuel1, Fuel2
1 parent dc833af commit 1b86336fa0fd4fe8ea8f569ce213a7b2613ea3a8
@hayashi hayashi authored on 3 Dec 2017
Showing 1 changed file
View
45
coverage/fuel3.html
];
}
});
 
const fuel1 = new ol.layer.VectorTile({
source: new ol.source.VectorTile({
format: new ol.format.MVT(),
url: "./tiles/tileFuel1/" + "{z}/{x}/{y}.pbf"
}),
title: "Fuel: 未入力",
visible: true,
opacity: 1,
style: function(feature){
return [
new ol.style.Style({
image: new ol.style.Circle({
radius: 6,
fill: new ol.style.Fill({color: "#ffc800"})
})
})
];
}
});
 
const fuel2 = new ol.layer.VectorTile({
source: new ol.source.VectorTile({
format: new ol.format.MVT(),
url: "./tiles/tileFuel2/" + "{z}/{x}/{y}.pbf"
}),
title: "Fuel: 未入力",
visible: true,
opacity: 1,
style: function(feature){
return [
new ol.style.Style({
image: new ol.style.Circle({
radius: 6,
fill: new ol.style.Fill({color: "#00ff00"})
})
})
];
}
});
 
 
const view = new ol.View({
center: ol.proj.fromLonLat([140.241,36.131]),
zoom: 9
zoom: 11
});
 
const map = new ol.Map({
target: "map",
controls: ol.control.defaults().extend([new ol.control.ScaleLine()]),
view: view,
layers: [ort, fuel0]
layers: [ort, fuel0, fuel1, fuel2]
});
 
map.on("click", function(evt){
const feature = map.forEachFeatureAtPixel(evt.pixel, function(feature){