Skip to content

Commit

Permalink
Merge pull request #21 from heremaps/geojson_style
Browse files Browse the repository at this point in the history
notebooks updated
  • Loading branch information
sackh authored Jun 8, 2021
2 parents 90e14fe + d6101c7 commit 3c39c55
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 8 additions & 3 deletions examples/custom_marker_icon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@
"outputs": [],
"source": [
"from here_map_widget import Map\n",
"from here_map_widget import GeoJSON\n",
"import os \n",
"import os\n",
"\n",
"m = Map(api_key=os.environ['LS_API_KEY'], center=center, zoom=17.847987922471717, tilt=51.031054687499804, heading=163.63541103795387)\n",
"m = Map(\n",
" api_key=os.environ[\"LS_API_KEY\"],\n",
" center=center,\n",
" zoom=17.84,\n",
" tilt=51.03,\n",
" heading=163.63,\n",
")\n",
"m.add_object(marker)\n",
"m"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/geodata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"m = Map(center=(52.3,8.0), zoom = 3, api_key=os.environ['LS_API_KEY'])\n",
"\n",
"rivers_data = GeoData(geo_dataframe = rivers,\n",
" style={'color': 'purple', 'opacity':3, 'weight':1.9, 'dashArray':'2', 'fillOpacity':0.6},\n",
" hover_style={'fillColor': 'red' , 'fillOpacity': 0.2},\n",
" style={'strokeColor': \"rgba(128,0,128,1)\"},\n",
" hover_style={'strokeColor': \"rgba(255,0,0,1)\"},\n",
" name = 'Rivers')\n",
"\n",
"m.add_layer(rivers_data)\n",
Expand Down
8 changes: 5 additions & 3 deletions examples/map_basics_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
"\n",
"m = Map(api_key=os.environ['LS_API_KEY'])\n",
"geojson = GeoJSON(url='https://gist.githubusercontent.com/peaksnail/5d4f07ca00ed7c653663d7874e0ab8e7/raw/64c2a975482efd9c42e54f6f6869f091055053cd/countries.geo.json', disable_legacy_mode=True, \n",
" style={\"fillColor\": \"#F5B041\", \"color\": \"black\", \"opacity\": 0.1}, show_bubble=True)\n",
" style={\"fillColor\": \"rgba(245, 176, 65, 0.5)\", \"strokeColor\": \"black\"}, show_bubble=True)\n",
"m.add_layer(geojson)\n",
"m"
]
Expand All @@ -276,9 +276,11 @@
" data = json.load(f)\n",
"\n",
"def call_back(feature):\n",
" return {\"fillColor\": \"#F5B041\", \"color\": \"black\", \"opacity\": 0.1}\n",
" return {\"fillColor\": \"rgba(245, 176, 65, 0.7)\", \"strokeColor\": \"black\", \"lineWidth\": 1}\n",
"\n",
"geojson = GeoJSON(data=data, style_callback=call_back, disable_legacy_mode=True)\n",
"hover_style = {\"fillColor\": \"rgba(245, 176, 65, 0.2)\", \"strokeColor\": \"red\", \"lineWidth\": 5}\n",
"\n",
"geojson = GeoJSON(data=data, style_callback=call_back, hover_style=hover_style, disable_legacy_mode=True)\n",
"m.add_layer(geojson)\n",
"m"
]
Expand Down

0 comments on commit 3c39c55

Please sign in to comment.