Add markers
Adding points from a CSV file to a map.
In [1]:
Copied!
import maplab
import maplab
In [2]:
Copied!
m = maplab.Map(center=(40, -100), zoom=4)
m = maplab.Map(center=(40, -100), zoom=4)
CSV file to marker cluster:
In [3]:
Copied!
# Be sure to define the path to your csv file, and the title of the columns that contain the latitude and longitude data
m.csv_to_markercluster('data/world_cities.csv')
m
# Be sure to define the path to your csv file, and the title of the columns that contain the latitude and longitude data
m.csv_to_markercluster('data/world_cities.csv')
m
Marker cluster added to map
Out[3]:
File path search in toolbar:
In [4]:
Copied!
#Just use the toolbar function and click the folder icon to browse your files
m.add_toolbar()
#Just use the toolbar function and click the folder icon to browse your files
m.add_toolbar()
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[4], line 2 1 #Just use the toolbar function and click the folder icon to browse your files ----> 2 m.add_toolbar() File ~/.local/lib/python3.9/site-packages/maplab/maplab.py:380, in Map.add_toolbar(self, position) 377 basemap.observe(change_basemap, names='value') 379 ### Marker info --> 380 import ipyfilechooser 382 marker = ipyfilechooser.FileChooser('/Users/') 384 marker_ctrl = ipyleaflet.WidgetControl(widget=marker, position='topright') ModuleNotFoundError: No module named 'ipyfilechooser'
Last update:
2023-05-11