Thank you for your reply. I’m not sure how I’m supposed to use this within the app since I’m not really familiar with JS and frontend dev.
The HTML of the map is as such:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IPyWidget export</title>
</head>
<body>
<!-- Load require.js. Delete this if your page already loads require.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@jupyter-widgets/html-manager@^0.20.0/dist/embed-amd.js" crossorigin="anonymous"></script>
<script type="application/vnd.jupyter.widget-state+json">
{
"version_major": 2,
"version_minor": 0,
"state": {
"0944f24610d343d09bcf41981098c54f": {
"model_name": "LeafletMapStyleModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {}
},
"6363dede50594cff83784d6f0d4a07d3": {
"model_name": "LeafletMapStyleModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"cursor": "move"
}
},
"80323d5e2a0049c5907f25518bdf56ac": {
"model_name": "LeafletTileLayerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"attribution": "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
"base": true,
"max_zoom": 19,
"min_zoom": 1,
"name": "OpenStreetMap.Mapnik",
"options": [
"attribution",
"detect_retina",
"max_native_zoom",
"max_zoom",
"min_native_zoom",
"min_zoom",
"no_wrap",
"tile_size",
"tms"
],
"url": "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
}
},
"59153c1440ea4313a800aeb06d476279": {
"model_name": "LayoutModel",
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"state": {}
},
"9bddcc51850b43a3a85c8350c56e6497": {
"model_name": "LeafletMapStyleModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {}
},
"7441d31d2c524dd083c2f2bbc3621c6a": {
"model_name": "LeafletMapModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"_dom_classes": [],
"bottom": 841070.0,
"center": [
33.55423099111111,
-7.624501421111111
],
"controls": [
"IPY_MODEL_0ec158a2a4724823a2ab46232e452e52",
"IPY_MODEL_095b54c3616b41e78d47800c0184ad03"
],
"crs": {
"name": "EPSG3857",
"custom": false
},
"default_style": "IPY_MODEL_0944f24610d343d09bcf41981098c54f",
"dragging_style": "IPY_MODEL_6363dede50594cff83784d6f0d4a07d3",
"east": -7.54039764404297,
"layers": [
"IPY_MODEL_80323d5e2a0049c5907f25518bdf56ac",
"IPY_MODEL_336d78d342e34d5a8f649e0c7fbe2faa",
"IPY_MODEL_0b730e24e99b417d92420731d284a7d5",
"IPY_MODEL_a33c4dea08d34fa3bdca86026e4dba05",
"IPY_MODEL_193c89961f1348248b68ee1c55790b8c"
],
"layout": "IPY_MODEL_59153c1440ea4313a800aeb06d476279",
"left": 1003670.0,
"north": 33.58287718199355,
"options": [
"bounce_at_zoom_limits",
"box_zoom",
"center",
"close_popup_on_click",
"double_click_zoom",
"dragging",
"fullscreen",
"inertia",
"inertia_deceleration",
"inertia_max_speed",
"interpolation",
"keyboard",
"keyboard_pan_offset",
"keyboard_zoom_offset",
"max_zoom",
"min_zoom",
"prefer_canvas",
"scroll_wheel_zoom",
"tap",
"tap_tolerance",
"touch_zoom",
"world_copy_jump",
"zoom",
"zoom_animation_threshold",
"zoom_delta",
"zoom_snap",
"zoom_start"
],
"right": 1004650.0,
"south": 33.52565471117594,
"style": "IPY_MODEL_9bddcc51850b43a3a85c8350c56e6497",
"top": 840670.0,
"west": -7.708625793457032,
"window_url": "http://localhost:8888/notebooks/Freterium.ipynb",
"zoom": 13.0
}
},
"0ec158a2a4724823a2ab46232e452e52": {
"model_name": "LeafletZoomControlModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"options": [
"position",
"zoom_in_text",
"zoom_in_title",
"zoom_out_text",
"zoom_out_title"
]
}
},
"095b54c3616b41e78d47800c0184ad03": {
"model_name": "LeafletAttributionControlModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"options": [
"position",
"prefix"
],
"position": "bottomright"
}
},
"336d78d342e34d5a8f649e0c7fbe2faa": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"location": [
33.5411488,
-7.5794811
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
},
"0b730e24e99b417d92420731d284a7d5": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"location": [
33.5722511,
-7.6629269
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
},
"1c4e4ad4ff7543ca8155028c98d93a1d": {
"model_name": "LeafletAwesomeIconModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"icon_color": "black",
"name": "fa-truck",
"options": []
}
},
"a33c4dea08d34fa3bdca86026e4dba05": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"icon": "IPY_MODEL_1c4e4ad4ff7543ca8155028c98d93a1d",
"location": [
33.5411488,
-7.5794811
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
},
"193c89961f1348248b68ee1c55790b8c": {
"model_name": "LeafletAntPathModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"color": "#7590ba",
"dash_array": [
1,
10
],
"delay": 1000,
"locations": [
[
33.5411488,
-7.5794811
],
[
33.5412402,
-7.5795595
],
[
33.5417331,
-7.57996
],
[
33.5418974,
-7.5800929
],
[
33.5432614,
-7.5812225
],
[
33.5433477,
-7.5813008
],
[
33.5444994,
-7.5822671
],
[
33.5445967,
-7.5823491
],
[
33.544988,
-7.5827073
],
[
33.5476859,
-7.5849085
],
[
33.5477722,
-7.5849964
],
[
33.5486292,
-7.5859519
],
[
33.5487275,
-7.5857875
],
[
33.5491853,
-7.5864057
],
[
33.5499662,
-7.5874609
],
[
33.5498439,
-7.587587
],
[
33.5506432,
-7.5884567
],
[
33.5511799,
-7.5889557
],
[
33.5515046,
-7.5892899
],
[
33.5522733,
-7.5900054
],
[
33.5527107,
-7.5904027
],
[
33.553079,
-7.5907443
],
[
33.5533807,
-7.5910218
],
[
33.5543522,
-7.5919123
],
[
33.5544572,
-7.5920105
],
[
33.5547075,
-7.5922415
],
[
33.555303,
-7.5927779
],
[
33.556003,
-7.5934134
],
[
33.5561335,
-7.5934934
],
[
33.5573642,
-7.5938461
],
[
33.5574403,
-7.5937775
],
[
33.5575852,
-7.5937772
],
[
33.5577144,
-7.5939521
],
[
33.5587309,
-7.5941295
],
[
33.5604774,
-7.5944197
],
[
33.5623692,
-7.5947609
],
[
33.5628041,
-7.5948519
],
[
33.5627912,
-7.5950528
],
[
33.5623265,
-7.5949738
],
[
33.561216,
-7.5947657
],
[
33.5606722,
-7.5946638
],
[
33.5602063,
-7.5945765
],
[
33.5599793,
-7.5945461
],
[
33.5587228,
-7.5983465
],
[
33.5575395,
-7.603906
],
[
33.5564333,
-7.6094216
],
[
33.5540941,
-7.6207419
],
[
33.5529865,
-7.6261197
],
[
33.5523421,
-7.6292593
],
[
33.5503488,
-7.63882
],
[
33.5483646,
-7.6451374
],
[
33.5475533,
-7.6462177
],
[
33.5452278,
-7.6508047
],
[
33.5422984,
-7.6558144
],
[
33.5405838,
-7.6587846
],
[
33.5399228,
-7.6598597
],
[
33.5390237,
-7.6615873
],
[
33.5390865,
-7.6627075
],
[
33.5408139,
-7.6629631
],
[
33.5417034,
-7.6628033
],
[
33.5433927,
-7.6634072
],
[
33.5434618,
-7.6635324
],
[
33.544123,
-7.6650199
],
[
33.5445102,
-7.6658912
],
[
33.5448511,
-7.666659
],
[
33.5451912,
-7.6674301
],
[
33.5454642,
-7.6680375
],
[
33.5458589,
-7.6689281
],
[
33.552523,
-7.6651507
],
[
33.5529399,
-7.6652832
],
[
33.5542562,
-7.6661919
],
[
33.5568652,
-7.6669174
],
[
33.5616769,
-7.6689237
],
[
33.5618333,
-7.6688144
],
[
33.5625284,
-7.668268
],
[
33.5632622,
-7.6681107
],
[
33.5648033,
-7.6678721
],
[
33.5697028,
-7.6678301
],
[
33.5702167,
-7.6678147
],
[
33.569963,
-7.6646805
],
[
33.5696344,
-7.6624301
],
[
33.5697328,
-7.6622584
],
[
33.5698635,
-7.6627064
],
[
33.5702491,
-7.6661483
],
[
33.5711631,
-7.6661208
],
[
33.5720282,
-7.6645927
],
[
33.5715266,
-7.6641963
],
[
33.5718282,
-7.6636678
],
[
33.572115,
-7.6631654
],
[
33.5722511,
-7.6629269
]
],
"options": [
"color",
"dash_array",
"delay",
"hardware_accelerated",
"paused",
"pulse_color",
"radius",
"reverse",
"use",
"weight"
],
"pulse_color": "#3f6fba"
}
},
"8ae9992fa96446e188104891b7c19fbd": {
"model_name": "LeafletMapStyleModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {}
},
"0e89c7aead624a8cab00545dbb97807f": {
"model_name": "LeafletMapStyleModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"cursor": "move"
}
},
"3e4768c27cb049aeae6c1acb8787fcfd": {
"model_name": "LeafletTileLayerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"attribution": "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
"base": true,
"max_zoom": 19,
"min_zoom": 1,
"name": "OpenStreetMap.Mapnik",
"options": [
"attribution",
"detect_retina",
"max_native_zoom",
"max_zoom",
"min_native_zoom",
"min_zoom",
"no_wrap",
"tile_size",
"tms"
],
"url": "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
}
},
"fdd9ed7251f641d88625343744de43cb": {
"model_name": "LayoutModel",
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"state": {}
},
"d8dafbff8d6b4b908c04bb3dbe8643bd": {
"model_name": "LeafletMapStyleModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {}
},
"07684481be414b05ab535cd9d9aac747": {
"model_name": "LeafletMapModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"_dom_classes": [],
"bottom": 841070.0,
"center": [
33.55423099111111,
-7.624501421111111
],
"controls": [
"IPY_MODEL_c6105abc8e5948f3953dad22ddb81d63",
"IPY_MODEL_0c3459b97b2f4a18af4a067b9e5dad19"
],
"crs": {
"name": "EPSG3857",
"custom": false
},
"default_style": "IPY_MODEL_8ae9992fa96446e188104891b7c19fbd",
"dragging_style": "IPY_MODEL_0e89c7aead624a8cab00545dbb97807f",
"east": -7.54039764404297,
"layers": [
"IPY_MODEL_3e4768c27cb049aeae6c1acb8787fcfd",
"IPY_MODEL_e9751bdd910c44919481e17b773a5166",
"IPY_MODEL_8d86106287664d48bf1f9948c3aded19",
"IPY_MODEL_6dda539017c443da9aecc847bcf3dbd2",
"IPY_MODEL_ea957e973c88408383c8725bf78f97c5"
],
"layout": "IPY_MODEL_fdd9ed7251f641d88625343744de43cb",
"left": 1003670.0,
"north": 33.58287718199355,
"options": [
"bounce_at_zoom_limits",
"box_zoom",
"center",
"close_popup_on_click",
"double_click_zoom",
"dragging",
"fullscreen",
"inertia",
"inertia_deceleration",
"inertia_max_speed",
"interpolation",
"keyboard",
"keyboard_pan_offset",
"keyboard_zoom_offset",
"max_zoom",
"min_zoom",
"prefer_canvas",
"scroll_wheel_zoom",
"tap",
"tap_tolerance",
"touch_zoom",
"world_copy_jump",
"zoom",
"zoom_animation_threshold",
"zoom_delta",
"zoom_snap",
"zoom_start"
],
"right": 1004650.0,
"south": 33.52565471117594,
"style": "IPY_MODEL_d8dafbff8d6b4b908c04bb3dbe8643bd",
"top": 840670.0,
"west": -7.708625793457032,
"window_url": "http://localhost:8888/notebooks/Freterium.ipynb",
"zoom": 13.0
}
},
"c6105abc8e5948f3953dad22ddb81d63": {
"model_name": "LeafletZoomControlModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"options": [
"position",
"zoom_in_text",
"zoom_in_title",
"zoom_out_text",
"zoom_out_title"
]
}
},
"0c3459b97b2f4a18af4a067b9e5dad19": {
"model_name": "LeafletAttributionControlModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"options": [
"position",
"prefix"
],
"position": "bottomright"
}
},
"e9751bdd910c44919481e17b773a5166": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"location": [
33.5411488,
-7.5794811
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
},
"8d86106287664d48bf1f9948c3aded19": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"location": [
33.5722511,
-7.6629269
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
},
"5fbd5ebf2911470789ca9ce02e302482": {
"model_name": "LeafletAwesomeIconModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"icon_color": "black",
"name": "fa-truck",
"options": []
}
},
"6dda539017c443da9aecc847bcf3dbd2": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"icon": "IPY_MODEL_5fbd5ebf2911470789ca9ce02e302482",
"location": [
33.5574403,
-7.5937775
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
},
"ea957e973c88408383c8725bf78f97c5": {
"model_name": "LeafletAntPathModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"color": "#7590ba",
"dash_array": [
1,
10
],
"delay": 1000,
"locations": [
[
33.5411488,
-7.5794811
],
[
33.5412402,
-7.5795595
],
[
33.5417331,
-7.57996
],
[
33.5418974,
-7.5800929
],
[
33.5432614,
-7.5812225
],
[
33.5433477,
-7.5813008
],
[
33.5444994,
-7.5822671
],
[
33.5445967,
-7.5823491
],
[
33.544988,
-7.5827073
],
[
33.5476859,
-7.5849085
],
[
33.5477722,
-7.5849964
],
[
33.5486292,
-7.5859519
],
[
33.5487275,
-7.5857875
],
[
33.5491853,
-7.5864057
],
[
33.5499662,
-7.5874609
],
[
33.5498439,
-7.587587
],
[
33.5506432,
-7.5884567
],
[
33.5511799,
-7.5889557
],
[
33.5515046,
-7.5892899
],
[
33.5522733,
-7.5900054
],
[
33.5527107,
-7.5904027
],
[
33.553079,
-7.5907443
],
[
33.5533807,
-7.5910218
],
[
33.5543522,
-7.5919123
],
[
33.5544572,
-7.5920105
],
[
33.5547075,
-7.5922415
],
[
33.555303,
-7.5927779
],
[
33.556003,
-7.5934134
],
[
33.5561335,
-7.5934934
],
[
33.5573642,
-7.5938461
],
[
33.5574403,
-7.5937775
],
[
33.5575852,
-7.5937772
],
[
33.5577144,
-7.5939521
],
[
33.5587309,
-7.5941295
],
[
33.5604774,
-7.5944197
],
[
33.5623692,
-7.5947609
],
[
33.5628041,
-7.5948519
],
[
33.5627912,
-7.5950528
],
[
33.5623265,
-7.5949738
],
[
33.561216,
-7.5947657
],
[
33.5606722,
-7.5946638
],
[
33.5602063,
-7.5945765
],
[
33.5599793,
-7.5945461
],
[
33.5587228,
-7.5983465
],
[
33.5575395,
-7.603906
],
[
33.5564333,
-7.6094216
],
[
33.5540941,
-7.6207419
],
[
33.5529865,
-7.6261197
],
[
33.5523421,
-7.6292593
],
[
33.5503488,
-7.63882
],
[
33.5483646,
-7.6451374
],
[
33.5475533,
-7.6462177
],
[
33.5452278,
-7.6508047
],
[
33.5422984,
-7.6558144
],
[
33.5405838,
-7.6587846
],
[
33.5399228,
-7.6598597
],
[
33.5390237,
-7.6615873
],
[
33.5390865,
-7.6627075
],
[
33.5408139,
-7.6629631
],
[
33.5417034,
-7.6628033
],
[
33.5433927,
-7.6634072
],
[
33.5434618,
-7.6635324
],
[
33.544123,
-7.6650199
],
[
33.5445102,
-7.6658912
],
[
33.5448511,
-7.666659
],
[
33.5451912,
-7.6674301
],
[
33.5454642,
-7.6680375
],
[
33.5458589,
-7.6689281
],
[
33.552523,
-7.6651507
],
[
33.5529399,
-7.6652832
],
[
33.5542562,
-7.6661919
],
[
33.5568652,
-7.6669174
],
[
33.5616769,
-7.6689237
],
[
33.5618333,
-7.6688144
],
[
33.5625284,
-7.668268
],
[
33.5632622,
-7.6681107
],
[
33.5648033,
-7.6678721
],
[
33.5697028,
-7.6678301
],
[
33.5702167,
-7.6678147
],
[
33.569963,
-7.6646805
],
[
33.5696344,
-7.6624301
],
[
33.5697328,
-7.6622584
],
[
33.5698635,
-7.6627064
],
[
33.5702491,
-7.6661483
],
[
33.5711631,
-7.6661208
],
[
33.5720282,
-7.6645927
],
[
33.5715266,
-7.6641963
],
[
33.5718282,
-7.6636678
],
[
33.572115,
-7.6631654
],
[
33.5722511,
-7.6629269
]
],
"options": [
"color",
"dash_array",
"delay",
"hardware_accelerated",
"paused",
"pulse_color",
"radius",
"reverse",
"use",
"weight"
],
"pulse_color": "#3f6fba"
}
}
}
}
</script>
<script type="application/vnd.jupyter.widget-view+json">
{"version_major": 2, "version_minor": 0, "model_id": "07684481be414b05ab535cd9d9aac747"}
</script>
</body>
</html>
The “make_map” server function returns this HTML which I pass to the Anvil form and it shows the static map correctly when I run the app. But not sure how to move the marker’s position after that. I think the relevant part of the HTML is :
6dda539017c443da9aecc847bcf3dbd2": {
"model_name": "LeafletMarkerModel",
"model_module": "jupyter-leaflet",
"model_module_version": "^0.15.0",
"state": {
"icon": "IPY_MODEL_5fbd5ebf2911470789ca9ce02e302482",
"location": [
33.5574403,
-7.5937775
],
"options": [
"alt",
"draggable",
"keyboard",
"rise_offset",
"rise_on_hover",
"rotation_angle",
"rotation_origin",
"title",
"z_index_offset"
]
}
}
Since that’s where I found the marker’s coordinates.