|
35 | 35 | "source": [ |
36 | 36 | "n = 1000\n", |
37 | 37 | "\n", |
38 | | - "# Create a list of lists that correspond to [[lat, lon], [lat, lon]]\n", |
| 38 | + "# Create a list of lists that correspond to [[lat, lon], [lat, lon]]\n", |
39 | 39 | "data = np.array([\n", |
40 | | - " np.random.uniform(low=35, high=60, size=n), # Random latitude\n", |
| 40 | + " np.random.uniform(low=35, high=60, size=n), # Random latitude\n", |
41 | 41 | " np.random.uniform(low=-12, high=30, size=n) # Random longitude\n", |
42 | 42 | "]).T.tolist()\n", |
43 | 43 | "\n", |
|
72 | 72 | } |
73 | 73 | ], |
74 | 74 | "source": [ |
75 | | - "# A custom callback can be passed to edit the markers.\n", |
76 | | - "# This should be a string representation of a valid JavaScript function.\n", |
| 75 | + "\"\"\"A custom callback can be passed to edit the markers.\n", |
| 76 | + " This should be a string representation of a valid JavaScript function.\n", |
| 77 | + "\"\"\"\n", |
77 | 78 | "callback = ('function (row) {' +\n", |
78 | | - " 'var icon, marker;' +\n", |
79 | | - " 'icon = L.AwesomeMarkers.icon({' +\n", |
80 | | - " 'icon: \"map-marker\", markerColor: \"red\"});' +\n", |
81 | | - " 'marker = L.marker(new L.LatLng(row[0], ' +\n", |
82 | | - " 'row[1]));' +\n", |
83 | | - " 'marker.setIcon(icon);' +\n", |
84 | | - " 'return marker;' +\n", |
85 | | - " '};')\n", |
| 79 | + " 'var icon, marker;' +\n", |
| 80 | + " 'icon = L.AwesomeMarkers.icon({' +\n", |
| 81 | + " 'icon: \"map-marker\", markerColor: \"red\"});' +\n", |
| 82 | + " 'marker = L.marker(new L.LatLng(row[0], ' +\n", |
| 83 | + " 'row[1]));' +\n", |
| 84 | + " 'marker.setIcon(icon);' +\n", |
| 85 | + " 'return marker;' +\n", |
| 86 | + " '};')\n", |
86 | 87 | "\n", |
87 | 88 | "m = folium.Map([45., 3.], zoom_start=6)\n", |
88 | 89 | "mc = plugins.FastMarkerCluster(data, callback=callback)\n", |
|
0 commit comments