From 5998f7ea4e9ebbfb03c6a366f7e60431138c41fd Mon Sep 17 00:00:00 2001 From: jin Date: Sat, 14 Oct 2023 16:29:22 +0300 Subject: [PATCH 1/2] api for geo jump --- map.view.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/map.view.ts b/map.view.ts index b486eb5..88b7c5c 100644 --- a/map.view.ts +++ b/map.view.ts @@ -70,6 +70,12 @@ namespace $.$$ { } + @ $mol_action + geo_jump( coord: $mol_vector_2d< number >, zoom = 1 ) { + this.zoom( zoom ) + this.center( this.Pane().geo_to_tile( coord ).multed0( -zoom ).added1( this.center_offset() ) ) + } + @ $mol_mem draw_uri() { return super.draw_uri() From ce9a634c5f26e417239fea45699ad4531b5da63e Mon Sep 17 00:00:00 2001 From: jin Date: Sat, 14 Oct 2023 17:00:49 +0300 Subject: [PATCH 2/2] fixed centering --- map.view.tree | 2 ++ 1 file changed, 2 insertions(+) diff --git a/map.view.tree b/map.view.tree index 0967c30..225e1c9 100644 --- a/map.view.tree +++ b/map.view.tree @@ -4,6 +4,8 @@ $hyoo_map $mol_view tiles_options * sketch \https://basemaps.cartocdn.com/rastertiles/voyager/{level}/{x}/{y}.png photo \https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{level}/{y}/{x} + auto / + <= center_offset null sub / <= Main $mol_page head /