Skip to content

Commit

Permalink
Deployed 5800d2e with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jan 16, 2024
1 parent 5a7f642 commit 094f366
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 46 deletions.
1 change: 1 addition & 0 deletions examples/custom_basemap/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def create_map():
m = create_map()
if len(sys.argv) == 2:
file_name = sys.argv[1]

with open(file_name, "w") as f:
f.write(m.to_html())

Expand Down
9 changes: 5 additions & 4 deletions examples/custom_basemap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -874,10 +874,11 @@ <h1>Custom basemap</h1>
</span><span id="__span-0-63"><a id="__codelineno-0-63" name="__codelineno-0-63" href="#__codelineno-0-63"></a> <span class="n">m</span> <span class="o">=</span> <span class="n">create_map</span><span class="p">()</span>
</span><span id="__span-0-64"><a id="__codelineno-0-64" name="__codelineno-0-64" href="#__codelineno-0-64"></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
</span><span id="__span-0-65"><a id="__codelineno-0-65" name="__codelineno-0-65" href="#__codelineno-0-65"></a> <span class="n">file_name</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
</span><span id="__span-0-66"><a id="__codelineno-0-66" name="__codelineno-0-66" href="#__codelineno-0-66"></a> <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">file_name</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
</span><span id="__span-0-67"><a id="__codelineno-0-67" name="__codelineno-0-67" href="#__codelineno-0-67"></a> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">m</span><span class="o">.</span><span class="n">to_html</span><span class="p">())</span>
</span><span id="__span-0-68"><a id="__codelineno-0-68" name="__codelineno-0-68" href="#__codelineno-0-68"></a>
</span><span id="__span-0-69"><a id="__codelineno-0-69" name="__codelineno-0-69" href="#__codelineno-0-69"></a> <span class="n">webbrowser</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
</span><span id="__span-0-66"><a id="__codelineno-0-66" name="__codelineno-0-66" href="#__codelineno-0-66"></a>
</span><span id="__span-0-67"><a id="__codelineno-0-67" name="__codelineno-0-67" href="#__codelineno-0-67"></a> <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">file_name</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
</span><span id="__span-0-68"><a id="__codelineno-0-68" name="__codelineno-0-68" href="#__codelineno-0-68"></a> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">m</span><span class="o">.</span><span class="n">to_html</span><span class="p">())</span>
</span><span id="__span-0-69"><a id="__codelineno-0-69" name="__codelineno-0-69" href="#__codelineno-0-69"></a>
</span><span id="__span-0-70"><a id="__codelineno-0-70" name="__codelineno-0-70" href="#__codelineno-0-70"></a> <span class="n">webbrowser</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">file_name</span><span class="p">)</span>
</span></code></pre></div>
<p><a href="app.html" target="_blank">See example in action</a></p>
<p>Run example:</p>
Expand Down
163 changes: 163 additions & 0 deletions examples/geopandas/app.html

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions examples/geopandas/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import webbrowser

from maplibre import Layer, LayerType, Map, MapOptions
Expand All @@ -6,7 +7,7 @@

import geopandas as gpd

TEMP_FILE = "/tmp/pymaplibregl_temp.html"
file_name = "/tmp/pymaplibregl_temp.html"
LAYER_ID = "wilderness"

df_geo = gpd.read_file(
Expand Down Expand Up @@ -34,7 +35,10 @@ def create_map():

if __name__ == "__main__":
m = create_map()
with open(TEMP_FILE, "w") as f:
if len(sys.argv) == 2:
file_name = sys.argv[1]

with open(file_name, "w") as f:
f.write(m.to_html())

webbrowser.open(TEMP_FILE)
webbrowser.open(file_name)
Loading

0 comments on commit 094f366

Please sign in to comment.