Add support to show polygons
See original GitHub issueHi there,
I would like to add support to show polygons. Before I start with an implementation, I would like to discuss with you the best approach.
I was thinking about the following steps:
- Create a new template
polygon.html
. - Create in
viz.py
a new ClassPolygonViz
. - Create in
viz.py
a new base ClassViz
.PolygonViz
,GraduatedCircleViz
, andCircleViz
inherit from this Class. Below is the rough outline of theViz
Class. - Create one polygon example jupyter notebook that proves the implementation.
I am happy for any feedback about the above. Since I am new to the project, I am also open for a complete different approach to show polygons.
Looking forward to work on this 😊
class Viz(object):
"""Base class for all visualisations"""
def __init__(self,
access_token=None,
center=(0, 0),
div_id='map',
height='500px',
style_url="mapbox://styles/mapbox/light-v9?optimize=true",
width='100%',
zoom=0):
if access_token is None:
access_token = os.environ.get('MAPBOX_ACCESS_TOKEN', '')
if not access_token.startswith('pk'):
raise TokenError('Mapbox access token must be public (pk)')
self.access_token = access_token
self.div_id = div_id
self.width = width
self.height = height
self.data = data
self.style_url = style_url
self.center = center
self.zoom = zoom
def as_iframe(self, html_data):
"""Build the HTML representation for the mapviz."""
...
def show(self, **kwargs):
"""Load the HTML iframe and display the the iframe in the current jupyter notebook view"""
...
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Create and Manage Map Polygons - Salesforce Help
Polygons make it easy to mass-update all appointments within a specific geographic area. ... Add a name, color, description, and service territory.
Read more >Style polygon layers—ArcGIS Online Help | Documentation
Style polygon layers with or without attributes with smart mapping styles. ... Click Outline color to see the outline color options:.
Read more >Add and Manage Polygons | iMapBuilder software
Click the Add Polygons button on the vertical toolbar. Click on the map to start drawing the shape. You can click on the...
Read more >Newly created polygons display differently from existing ...
Solution: · Select the affected object or mesh. · In the Editable-Poly Sub-Object mode, choose Polygon. · Select a polygon in the model...
Read more >Create and Display Polygons - MATLAB & Simulink - MathWorks
Create a polygon by listing vertices that define its boundaries without intersecting. The order of the vertices determines what parts of the polygon...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Glad to see that someone picked up the work! Sorry that I was a bit slow on this. Awesome to see that there is now so much traction on the project 👏
Yes, I actually have a branch sitting here that I want to finish up 😃
I’ll try to open a PR by the end of the week 🤞