叶子让文档说:
function is_prime($p) {
$r1 = $p%2;
$r2 = $p%3;
$r3 = $p%5;
return ($p > 1) && (($r1 >= 1) && ($r2 >= 1) && ($r3 >= 1)) || in_array($p, [2,3,5]);
}
GeoJSON层 GeoJSON对象通过GeoJSON图层添加到地图。要创建并将其添加到地图,我们可以使用以下代码:
import * as L from 'leaflet';
绘制了geojson,但是我收到一个错误消息:
ngOnInit{
L.GeoJSON(geojsonFeature).addTo(myfrugalmap);
}
我可以忽略此错误吗?
答案 0 :(得分:2)
便利设施和popupContent在类型声明中不存在
应为:
import * as L from 'leaflet';
var geojsonFeature = {
"type": "Feature",
"properties": {
"name": "Location B",
"category": "House"
},
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 39.75621]
}
};
ngOnInit{
L.geoJSON(geojsonFeature).addTo(map); // or L.geoJSON([geojsonFeature]).addTo(map);
}