|
Is there a method to preload a bookmarks.json file into the bookmark tool, so the saved locations are already loaded in the html file. This would allow you to have the user look at particular points of interest without sending and loading a separate file. Thx |
Answered by
giswqs
Mar 8, 2026
Replies: 2 comments 1 reply
|
Upgrade to v0.14.0. from anymap_ts import Map
m = Map(center=[-122.4, 37.8], zoom=10)
m.add_control_grid(
bookmark_options={
"bookmarks": [
{
"id": "nyc",
"name": "New York City",
"lng": -74.006,
"lat": 40.7128,
"zoom": 12,
"pitch": 0,
"bearing": 0,
"createdAt": 0,
},
{
"id": "sf",
"name": "San Francisco",
"lng": -122.4194,
"lat": 37.7749,
"zoom": 12,
"pitch": 0,
"bearing": 0,
"createdAt": 0,
},
],
},
)
m.to_html("map.html")
m |
0 replies
Answer selected by
giswqs
|
Thanks again for your rapid response. This makes the bookmark function much easier for users to handle. Great podcast, Sleep is Highly Overrated!
…________________________________
From: Qiusheng Wu ***@***.***>
Sent: Saturday, March 7, 2026 9:11 PM
To: opengeos/anymap-ts ***@***.***>
Cc: pd-allen ***@***.***>; Author ***@***.***>
Subject: Re: [opengeos/anymap-ts] Preloading Bookmarks (Discussion #136)
Upgrade to v0.14.0.
from anymap_ts import Map
m = Map(center=[-122.4, 37.8], zoom=10)
m.add_control_grid(
bookmark_options={
"bookmarks": [
{
"id": "nyc",
"name": "New York City",
"lng": -74.006,
"lat": 40.7128,
"zoom": 12,
"pitch": 0,
"bearing": 0,
"createdAt": 0,
},
{
"id": "sf",
"name": "San Francisco",
"lng": -122.4194,
"lat": 37.7749,
"zoom": 12,
"pitch": 0,
"bearing": 0,
"createdAt": 0,
},
],
},
)
m.to_html("map.html")
m
—
Reply to this email directly, view it on GitHub<#136 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKMIZXHVE6KIOPSLM7ULTGD4PTJDNAVCNFSM6AAAAACWKE2H6KVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMBTG42DIOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upgrade to v0.14.0.