From cd2a07f6deab72c927f55d98f8991f3251b22768 Mon Sep 17 00:00:00 2001 From: fustyles <34397289+fustyles@users.noreply.github.com> Date: Wed, 1 Jan 2025 19:16:45 +0800 Subject: [PATCH] Update googlemap.js --- SpBlocklyJS/googlemap_20241226/googlemap.js | 59 ++++++++++----------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/SpBlocklyJS/googlemap_20241226/googlemap.js b/SpBlocklyJS/googlemap_20241226/googlemap.js index 7589b25f6b..0a53ae043a 100644 --- a/SpBlocklyJS/googlemap_20241226/googlemap.js +++ b/SpBlocklyJS/googlemap_20241226/googlemap.js @@ -87,6 +87,35 @@ function updateMarkerContent(pID, newContent, type) { } } +function updateMapContent(pMapId, val, type) { + if (type=="zoomMap") { + pMapId.setZoom(Number(val)); + } + else if (type=="headingMap") { + let povData = { + heading: Number(val), + pitch: pMapId.getPov().pitch + }; + pMapId.setPov(povData); + } + else if (type === "pitchMap") { + let povData = { + heading: pMapId.getPov().heading, + pitch: Number(val) + }; + pMapId.setPov(povData); + } + else if (type === "clearMap") { + for (var i=0;i