提交 3268cb75 编写于 作者: K kinghzking

Thu Nov 16 10:46:00 CST 2023 inscode

上级 dee3bc6d
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="map"></div>
<script src="./index.js" />
</body>
</html>
\ No newline at end of file
// Import stylesheets
import './style.css';
import { Map, TileLayer } from 'leaflet';
// Write Javascript code!
const map = new Map('map');
const layer = new TileLayer(
'http://wprd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=7',
{
subdomains: '1234'
}
);
layer.addTo(map);
map.setView([39.909186, 116.397411], 10);
@import '~leaflet/dist/leaflet.css';
html,
body {
width: 100%;
height: 100%;
margin: 0px;
}
h1,
h2 {
font-family: Lato;
}
#map {
width: 100%;
height: 100%;
}
{
"name": "myopen",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "myopen",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"leaflet": "^1.9.4"
}
},
"node_modules/leaflet": {
"version": "1.9.4",
"resolved": "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.4.tgz",
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA=="
}
}
}
{
"name": "myopen",
"version": "1.0.0",
"description": "just 4 learn",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"study"
],
"author": "yemao",
"license": "ISC",
"dependencies": {
"leaflet": "^1.9.4"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册