Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fustyles authored Dec 27, 2024
1 parent 3cfd92a commit 239575d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion SpBlocklyJS/googlemap_20241226/googlemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@ function addMapPoint(pID, pMapId, pLat, pLng, pTitle, pContent) {
mapMarkers.push([pID, pMapId, marker]);
}

function clearMapPoint(pID) {
function clearMarker(pID) {
for (var i=0;i<mapMarkers.length;i++) {
if ("point_"+pID==mapMarkers[i][0]) {
mapMarkers[i][2].setMap(null);
mapMarkers.splice(i, 1);
break;
}
}
}

function updateMarkerContent(pID, newContent) {
for (var i=0;i<mapMarkers.length;i++) {
if ("point_"+pID==mapMarkers[i][0]) {
const infoWindow = new google.maps.InfoWindow({
content: newContent
});
infoWindow.open(mapMarkers[i][1], mapMarkers[i][2]);
break;
}
}
}
Expand All @@ -35,6 +49,8 @@ function clearMap(pMap) {
for (var i=0;i<mapMarkers.length;i++) {
if (pMap==mapMarkers[i][1]) {
mapMarkers[i][2].setMap(null);
mapMarkers.splice(i, 1);
i--;
}
}
}

0 comments on commit 239575d

Please sign in to comment.