R传单库中是否有等效的pointToLayer函数

R传单库中是否有等效的pointToLayer函数,r,shiny,leaflet,r-leaflet,R,Shiny,Leaflet,R Leaflet,我不熟悉传单和R。 我正在尝试用R(传单和闪亮)创建交互式地图。我基本上需要在地图上用点追踪路线。数据来自一个GeoJSON文件,该文件的属性需要用于样式选项。早期的html传单实现如下所示: L.geoJson(route2aug,{ style: function (feature) { return feature.properties && feature.properties.style; },

我不熟悉传单和R。 我正在尝试用R(传单和闪亮)创建交互式地图。我基本上需要在地图上用点追踪路线。数据来自一个GeoJSON文件,该文件的属性需要用于样式选项。早期的html传单实现如下所示:

L.geoJson(route2aug,{
    style: function (feature) {
            return feature.properties && feature.properties.style;
                },

    pointToLayer : function(feature,latlng){
               var popupContent = "Sootmass:" + String(feature.properties.sootmass);    
               var popupOptions = {maxWidth: 200};
               return L.circleMarker(latlng,{
             radius: 4,
                         fillColor: getColor(feature.properties.sootmass),
                         color: getColor(feature.properties.sootmass),
                             weight: 1,
                             opacity: 1,
                         fillOpacity: 0.8
                }).bindPopup(popupContent, popupOptions);
               }

    }).addTo(map);
{"geometry": {"type": "Point", "coordinates": [77.68137666666667, 12.926686666666667]}, "type": "Feature", "properties": {"sootmass": 5}},{"geometry": {"type": "Point", "coordinates": [77.68138666666667, 12.926686666666667]}, "type": "Feature", "properties": {"sootmass": 10}},{"geometry": {"type": "Point", "coordinates": [77.681405, 12.926688333333335]}, "type": "Feature", "properties": {"sootmass": 15}}.......}
这里,数据来自route2aug文件,该文件作为js对象导入。我需要用传单在R中复制这个。 有没有办法在R中做同样的事情? GeoJSON数据文件如下所示:

L.geoJson(route2aug,{
    style: function (feature) {
            return feature.properties && feature.properties.style;
                },

    pointToLayer : function(feature,latlng){
               var popupContent = "Sootmass:" + String(feature.properties.sootmass);    
               var popupOptions = {maxWidth: 200};
               return L.circleMarker(latlng,{
             radius: 4,
                         fillColor: getColor(feature.properties.sootmass),
                         color: getColor(feature.properties.sootmass),
                             weight: 1,
                             opacity: 1,
                         fillOpacity: 0.8
                }).bindPopup(popupContent, popupOptions);
               }

    }).addTo(map);
{"geometry": {"type": "Point", "coordinates": [77.68137666666667, 12.926686666666667]}, "type": "Feature", "properties": {"sootmass": 5}},{"geometry": {"type": "Point", "coordinates": [77.68138666666667, 12.926686666666667]}, "type": "Feature", "properties": {"sootmass": 10}},{"geometry": {"type": "Point", "coordinates": [77.681405, 12.926688333333335]}, "type": "Feature", "properties": {"sootmass": 15}}.......}

在更抽象的层面上,您想要实现什么?我想要在地图上单击点时根据位置创建一个R图(算法的输出),如这里的svg示例所示?对像这样的。但我在想闪亮的路线。但这真的很有帮助。@TimSalabim:谢谢你提供的一站式解决方案。它是否按原样接收GeoJSON数据?