Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xplot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
digit_plot
xplot
Commits
8ca9389a
Commit
8ca9389a
authored
Oct 13, 2024
by
dliangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tauri version update
parent
2533a109
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
56 deletions
+34
-56
src-tauri/Cargo.lock
+0
-0
src-tauri/Cargo.toml
+4
-4
src/components/land/Land.tsx
+10
-43
src/components/layers/Layers.tsx
+20
-9
yarn.lock
+0
-0
No files found.
src-tauri/Cargo.lock
View file @
8ca9389a
This diff is collapsed.
Click to expand it.
src-tauri/Cargo.toml
View file @
8ca9389a
...
@@ -12,12 +12,12 @@ name = "xplot_lib"
...
@@ -12,12 +12,12 @@ name = "xplot_lib"
crate-type
=
[
"lib"
,
"cdylib"
,
"staticlib"
]
crate-type
=
[
"lib"
,
"cdylib"
,
"staticlib"
]
[build-dependencies]
[build-dependencies]
tauri-build
=
{
version
=
"2.0.0
-rc
"
,
features
=
[]
}
tauri-build
=
{
version
=
"2.0.0"
,
features
=
[]
}
[dependencies]
[dependencies]
tauri
=
{
version
=
"2.0.0
-rc
"
,
features
=
[]
}
tauri
=
{
version
=
"2.0.0"
,
features
=
[]
}
tauri-plugin-shell
=
"2.0.0
-rc
"
tauri-plugin-shell
=
"2.0.0"
serde
=
{
version
=
"1"
,
features
=
["derive"]
}
serde
=
{
version
=
"1"
,
features
=
["derive"]
}
serde_json
=
"1"
serde_json
=
"1"
tauri-plugin-http
=
"2.0.0
-rc
"
tauri-plugin-http
=
"2.0.0"
src/components/land/Land.tsx
View file @
8ca9389a
import
{
useEffect
,
useRef
}
from
"react
"
;
import
"ol/ol.css
"
;
import
Footer
from
"../common/Footer"
;
import
Footer
from
"../common/Footer"
;
import
Map
from
'ol/Map'
;
import
"./Land.css"
;
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"
;
const
Land
=
()
=>
{
const
Land
=
()
=>
{
const
mapRef
=
useRef
(
null
);
return
(
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}'
,
<
Footer
></
Footer
>
});
</>
);
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
>
</>)
}
export
default
Land
;
export
default
Land
;
\ No newline at end of file
src/components/layers/Layers.tsx
View file @
8ca9389a
...
@@ -8,7 +8,7 @@ import XYZ from "ol/source/XYZ";
...
@@ -8,7 +8,7 @@ import XYZ from "ol/source/XYZ";
const
Layers
=
()
=>
{
const
Layers
=
()
=>
{
const
mapRef
=
useRef
(
null
);
const
mapRef
=
useRef
(
null
);
const
gaodeSource
=
new
XYZ
({
const
gaodeSource
=
new
XYZ
({
url
:
"https://web
rd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8
&x={x}&y={y}&z={z}"
,
url
:
"https://web
st01.is.autonavi.com/appmaptile?style=6
&x={x}&y={y}&z={z}"
,
});
});
const
gaodeLayer
=
new
TileLayer
({
const
gaodeLayer
=
new
TileLayer
({
...
@@ -18,15 +18,26 @@ const Layers = () => {
...
@@ -18,15 +18,26 @@ const Layers = () => {
if
(
mapRef
.
current
)
{
if
(
mapRef
.
current
)
{
const
map
=
new
Map
({
const
map
=
new
Map
({
target
:
mapRef
.
current
,
target
:
mapRef
.
current
,
layers
:
[
gaodeLayer
],
layers
:
[
view
:
new
View
({
new
TileLayer
({
center
:
[
0
,
0
],
source
:
new
XYZ
({
zoom
:
3
,
url
:
'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
,
minZoom
:
3
,
// 设置最小缩放等级为 5
}),
maxZoom
:
18
,
// 设置最大缩放等级为 15
}),
// 高德卫星图层
}),
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
()
=>
{
return
()
=>
{
map
.
setTarget
();
map
.
setTarget
();
};
};
...
...
yarn.lock
View file @
8ca9389a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment