Commit 8ca9389a by dliangx

tauri version update

parent 2533a109
......@@ -12,12 +12,12 @@ name = "xplot_lib"
crate-type = ["lib", "cdylib", "staticlib"]
[build-dependencies]
tauri-build = { version = "2.0.0-rc", features = [] }
tauri-build = { version = "2.0.0", features = [] }
[dependencies]
tauri = { version = "2.0.0-rc", features = [] }
tauri-plugin-shell = "2.0.0-rc"
tauri = { version = "2.0.0", features = [] }
tauri-plugin-shell = "2.0.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-http = "2.0.0-rc"
tauri-plugin-http = "2.0.0"
import { useEffect, useRef } from "react";
import "ol/ol.css";
import Footer from "../common/Footer";
import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
import 'ol/ol.css';
import './Land.css'
import XYZ from "ol/source/XYZ";
import "./Land.css";
const Land = ()=>{
const mapRef = useRef(null);
const gaodeSource = new XYZ({
url: 'https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
});
const gaodeLayer = new TileLayer({
source: gaodeSource,
});
useEffect(() => {
if (mapRef.current) {
const map = new Map({
target: mapRef.current,
layers: [
gaodeLayer
],
view: new View({
center: [0, 0],
zoom: 3,
}),
});
return () => {
map.setTarget();
};
}
}, []);
return(<>
<div ref={mapRef} className=" bottom-14 h-3/5 w-full absolute"></div>
<Footer></Footer>
</>)
}
const Land = () => {
return (
<>
<Footer></Footer>
</>
);
};
export default Land;
\ No newline at end of file
export default Land;
......@@ -8,7 +8,7 @@ import XYZ from "ol/source/XYZ";
const Layers = () => {
const mapRef = useRef(null);
const gaodeSource = new XYZ({
url: "https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
url: "https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
});
const gaodeLayer = new TileLayer({
......@@ -18,15 +18,26 @@ const Layers = () => {
if (mapRef.current) {
const map = new Map({
target: mapRef.current,
layers: [gaodeLayer],
view: new View({
center: [0, 0],
zoom: 3,
minZoom: 3, // 设置最小缩放等级为 5
maxZoom: 18, // 设置最大缩放等级为 15
}),
layers: [
new TileLayer({
source: new XYZ({
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
}),
}), // 高德卫星图层
new TileLayer({
source: new XYZ({
url: 'https://wprd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=8',
}),
}), // 高德道路图层
],
view: new View({
center: [120, 30],
zoom: 3,
maxZoom:18,
minZoom:3
}),
});
return () => {
map.setTarget();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment