添加高德地图密钥

This commit is contained in:
jiayu 2025-02-26 15:57:09 +08:00
parent e9e25ad53d
commit 9fa14af042

View File

@ -1,16 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title> <title><%- title %></title>
<%- title %> </head>
</title>
</head>
<body> <body>
<div id="app"> <div id="app">
<style> <style>
html, html,
@ -115,9 +112,14 @@
dot.forEach(item => (item.style.background = color)); dot.forEach(item => (item.style.background = color));
if (isDark) html.style.background = "#141414"; if (isDark) html.style.background = "#141414";
} }
// 高德地图自2021年12月02日升级升级之后所申请的 key 必须配备安全密钥 jscode 一起使用
window._AMapSecurityConfig = { securityJsCode: "7375e94447ea4d636b3d12d639ba21ec" };
</script> </script>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<script src="https://webapi.amap.com/maps?v=2.0&key=1eb65a4a1e436b5314d23b773cd4e658&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.MouseTool,AMap.Geocoder,AMap.Driving" defer="defer"></script> <script
src="https://webapi.amap.com/maps?v=2.0&key=1eb65a4a1e436b5314d23b773cd4e658&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.MouseTool,AMap.Geocoder,AMap.Driving"
defer="defer"
></script>
<script src="/jquery-1.12.4.min.js"></script> <script src="/jquery-1.12.4.min.js"></script>
<!-- 用于前端与插件交互 --> <!-- 用于前端与插件交互 -->
<script src="/jsencrypt.min.js"></script> <script src="/jsencrypt.min.js"></script>
@ -135,7 +137,7 @@
// 禁用鼠标滚动事件 // 禁用鼠标滚动事件
document.addEventListener( document.addEventListener(
"keydown", "keydown",
function(event) { function (event) {
if ( if (
(event.ctrlKey === true || event.metaKey === true) && (event.ctrlKey === true || event.metaKey === true) &&
(event.which === 61 || (event.which === 61 ||
@ -153,11 +155,12 @@
// Chrome IE 360 // Chrome IE 360
window.addEventListener( window.addEventListener(
"mousewheel", "mousewheel",
function(event) { function (event) {
if (event.ctrlKey === true || event.metaKey) { if (event.ctrlKey === true || event.metaKey) {
event.preventDefault(); event.preventDefault();
} }
}, { },
{
passive: false passive: false
} }
); );
@ -165,15 +168,15 @@
//firefox //firefox
window.addEventListener( window.addEventListener(
"DOMMouseScroll", "DOMMouseScroll",
function(event) { function (event) {
if (event.ctrlKey === true || event.metaKey) { if (event.ctrlKey === true || event.metaKey) {
event.preventDefault(); event.preventDefault();
} }
}, { },
{
passive: false passive: false
} }
); );
</script> </script>
</body> </body>
</html> </html>