Hello,
I have a problem with my generation of map. In fact, I obtain double quotes in my source code, so I get "this._group.options.iconCreateFunction is not a function" message in Firefox.
Sample of my script :
# Create Map
obj_map_cluster = folium.Map(
# Latitude and Longitude of Map (Northing, Easting)
location=[46.5286, 2.4389],
# Forces Leaflet to use the Canvas back-end for vector layers instead of SVG
prefer_canvas=True,
# Map tileset to use
tiles='cartodbdark_matter',
# Initial zoom level for the map
zoom_start=6
)
# Assign icon create function
obj_markercluster = plugins.MarkerCluster(
icon_create_function="""
function (cluster) {
return L.divIcon({ html: cluster.getChildCount(), className: 'mycluster', iconSize: L.point(40, 40) });
}
"""
)
# Create Marker
obj_marker = folium.Marker([DEFINITION OF MARKER])
obj_markercluster.add_child(obj_marker)
obj_markercluster.add_to(obj_map_cluster)
obj_map_cluster.save('sites_cluster.html')
Problem description
HTML source code is :
"iconCreateFunction": "function (cluster) {\n return L.divIcon({ html: cluster.getChildCount(), iconSize: L.point(40, 40) });\n}"
Expected Output
To work, I would like :
iconCreateFunction: function (cluster) { return L.divIcon({ html: cluster.getChildCount(), iconSize: L.point(40, 40) });}
Without '"' and '\n'
Output of folium.__version__
My version is 0.6.0+11.g71ab988
Thank you !
Hello,
I have a problem with my generation of map. In fact, I obtain double quotes in my source code, so I get "this._group.options.iconCreateFunction is not a function" message in Firefox.
Sample of my script :
Problem description
HTML source code is :
"iconCreateFunction": "function (cluster) {\n return L.divIcon({ html: cluster.getChildCount(), iconSize: L.point(40, 40) });\n}"Expected Output
To work, I would like :
iconCreateFunction: function (cluster) { return L.divIcon({ html: cluster.getChildCount(), iconSize: L.point(40, 40) });}Without '"' and '\n'
Output of
folium.__version__My version is 0.6.0+11.g71ab988
Thank you !