Leaflet style-and onEachFeature函数读取*geojson文件有什么区别

Leaflet style-and onEachFeature函数读取*geojson文件有什么区别,leaflet,styles,geojson,Leaflet,Styles,Geojson,我使用 $.ajax(overlay).done(function(data) { data = JSON.parse(data); L.geoJson(data, { pointToLayer: pointToLayer, style: style, onEachFeature: onEachFeature }); return}); 据我所知(新手),对于文件中的每个标记,将处理pointToL

我使用

$.ajax(overlay).done(function(data) {
    data = JSON.parse(data);
    L.geoJson(data, {
            pointToLayer: pointToLayer,
            style: style,
            onEachFeature: onEachFeature
    });
return});
据我所知(新手),对于文件中的每个标记,将处理pointToLayer-函数,对于每个多边形和线字符串,将处理style函数和onEachFeature函数。对吗? 最后两个函数之间有什么区别(不考虑名称)

格劳斯,王八蛋
  • pointToLayer
    回调函数在所有
    Point
    GeoJSON特性上运行,然后
  • style
    函数在所有
    LineString
    Polygon
    GeoJSON功能上运行,然后
  • onEachFeature
    回调函数在点(现在是
    L.Marker
    s)和线串/多边形(现在是
    L.Polyline
    s和
    L.Polygon
    s)上运行

  • 请注意,
    pointToLayer
    style
    采用GeoJSON特性作为输入,而
    onEachFeature
    也采用
    L.Layer
    的实例。
    L.Layer
    可以来自调用
    pointToLayer
    或者内部带有
    样式调用中的信息。

    返回
    的最终目的是什么?对不起,应该省略“返回”。