我正在使用openlayers,我创建了许多矢量层,但是我想将click事件放在一个矢量层上。
function add_map_point(lat, lng) {
var vectorLayer = new ol.layer.Vector({
source:new ol.source.Vector({
features: [new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([parseFloat(lng), parseFloat(lat)], 'EPSG:4326', 'EPSG:3857')),
})]
}),
style: new ol.style.Style({
image: new ol.style.Icon({
anchor: [0.5, 0.5],
anchorXUnits: "fraction",
anchorYUnits: "fraction",
src: "{{asset('marker.png')}}",
}),
})
});
map.addLayer(vectorLayer);
}
function map_points(){
@foreach($data as $c)
add_map_point({{$c->latitude}}, {{$c->longitude}});
@endforeach
}
答案 0 :(得分:0)
请尝试添加到您的功能中
FileSystemAlreadyExistsException