JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>
  <head>
    <title>同伴監看示範</title>
	<!-- 主要程式架構參考自 https://developers.google.com/maps/documentation/javascript/examples/event-arguments?hl=zh-tw -->
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 80%;
      }
    </style>
	
	<!-- Firebase程式範例參考自 http://practical-dbm.blogspot.tw/search/label/Firebase -->
	<script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script>
	<script>
	  // Initialize Firebase
	  var firebaseConfig = {
		apiKey: "專案API金鑰號碼",				// 若資料庫為PUBLIC就不需要這行
		authDomain: "專案驗證網址",				// 若資料庫為PUBLIC就不需要這行
		databaseURL: "https://專案資料庫網址",
		projectId: "project-id",
		storageBucket: "專案檔案空間",			// 若不使用檔案空間就不需要這行
		messagingSenderId: "專案通知傳送序號"	// 若不使用通知傳送就不需要這行
		appID: "app-id",						// 若資料庫為PUBLIC就不需要這行
	  }; 
      firebase.initializeApp(firebaseConfig);
	</script>
  </head>
  <body>
  
    <div id="map"></div>
	
	<!-- 多增加一個msg區塊用以呈現必要的資訊 -->
	<p>若另一支程式在地圖上點一下,應該可以看到在這支程式同步呈現該位置...</p>
	<div id="msg"></div>
	
    <script>
	
	//將原範例程式在placeMarkerAndPanTo()中的marker變數改成宣告為整體性變數
	var marker;
	
	function initMap() {
	  var map = new google.maps.Map(document.getElementById('map'), {
		zoom: 17,
		center: {lat: 24.121438, lng: 120.675038 }
	  });
	  
	  marker = new google.maps.Marker({
		position: {lat: 1, lng: 1 },	//第一個標記放在很遠看不到的
		map: map
	  });
	  
	  //被陪伴者Firebase的資料一旦有異動就即時取得並在地圖上呈現
	  firebase.database().ref('User00001').on("value", function(snapshot) {
	    var pos = {
		  lat: snapshot.val().currentLat,
		  lng: snapshot.val().currentLng
	    };
	    placeMarkerAndPanTo(pos, map);
	  });
	}

	function placeMarkerAndPanTo(latLng, map) {
	  //在新增前先移除舊的標記
	  marker.setMap(null);
	  //這裡改成是以整體性變數marker記住新標記
	  marker = new google.maps.Marker({
		position: latLng,
		animation: google.maps.Animation.DROP,
		map: map
	  });
	 ...