<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Google Map</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<script>
const navigation = (url) => window.open(encodeURI(url), '_blank');
const getStaticMap = () => {
const destination = '高雄夢時代';
const destination_mark = `color:red|label:D|${destination}`;
const src = `https:
$('#img1').attr('src', encodeURI(src));
};
const getStaticMapNav = () => {
const position = `高雄夢時代|高雄火車站`;
const src = `https:
$('#img2').attr('src', encodeURI(src));
};
</script>
<div>
<button onClick="navigation(`http://maps.google.com/maps?saddr=Current+Location&daddr=高雄夢時代`)">
URL1
</button>
<button onClick="navigation(`http://maps.google.com/maps?saddr=Current+Location&daddr=22.5961822,120.3062948`)">
URL2
</button>
</div>
<div>
<button onClick="getStaticMap()">
Google Static Map
</button>
<img id="img1" src="" alt="Google Static Map">
</div>
<div>
<button onClick="getStaticMapNav()">
Google Static Map Navigation
</button>
<img id="img2" src="" alt="Google Static Map Navigation">
</div>
</body>
</html>