我试图为约旦的城市制作谷歌地图,当点击标记时,该地图会向用户显示有关城市的信息
我的问题是当我试图获得用户点击的标记时,它总是发送For循环中的最后一个标记来实例化标记并提供信息
for-loop工作将为每个标记赋予它自己的标题,标签并为每个标记提供一个事件监听器
如何获得点击的标记?
<!DOCTYPE html>
<html>
<head>
<title>Gis Map</title>
<style>
.background {} p {
background-color: white;
}
span {
color: blue;
}
#Footer {
width: 100%;
height: 30px;
position: relative;
left: 0px;
bottom: 0px;
}
#Footer_text {
padding: 10px;
color: black;
background-color: #5B1B14;
}
#Fixed {
position: fixed;
top: 0px;
left: 0px;
height: 70px;
width: 100%;
z-index: 3;
background-color: #5B1B14;
}
#Fixed_img_c {
width: 20%;
height: 100%;
margin: 0 auto;
}
#Fixed_img {
height: 100%;
}
.paragraphs {
text-align: …Run Code Online (Sandbox Code Playgroud)