I want to create a geographic map with two different markers. The primary marker is on the basis of (lat, long), while the second one would be on the basis of zip codes. I am able to plot the location on the basis of lat, lon but I donāt know if it is possible to plot the zips in the same map or even zips on a different map.
My main objective is to show the location of a store and all the zip codes surrounding that location.
All of this data is in a csv file.
If it is not possible with plotly can I use any other library for this purpose?
Thanks,
You can add multiple Scattergeo traces to a single plot.
For the first trace you could set the mode property to 'markers' and the lat/lon properties to the coordinates of your markers.
For the second trace you could set the mode property to 'text', the text property to the zip code strings, and the lat/lon properties to the coordinates of the zip codes (You would need some way to convert zip code to coordinates).
@jmmease Sorry for such a late reply, what I am trying to do is to create something similar to a folium map.
In folium map, I have two kinds of coordinates first are the store coordinates that I am using to plot the marker(like a point marker).
second is the coordinates that I am getting from the zipcodes and I am using them to create a choropleth map.
So my map is a choropleth map with zip codes used to create choropleth and then store coordinates to create markers.
Is something like this possible on dash/plotly?
I am attaching a screenshot for reference.
I think the closest example to what your doing is https://plot.ly/python/mapbox-county-choropleth/. But to reproduce it with zip codes you would need to come up with your own data source that contains the geometry of the zip code boundaries.
Thanks @jmmease,
I tried creating something like that but i canāt figure out how to create the colorscale based on the sales. i created a map from geojson that has all the geometry and sales as a property. I donāt know how to use the geojson[āfeatureā][i][āpropertiesā][āsalesā] to map the colors intensity in the map. Is there any examples for that?
I think what you would need to do is bin your geojson['feature'][i]['properties']['sales'] values and then create a separate layer for each binned value.