Skip to content

Commit

Permalink
fix: can not sync map center that mouse move end
Browse files Browse the repository at this point in the history
fixed #11
  • Loading branch information
yue1123 committed Sep 12, 2022
1 parent 22d1e6f commit 5cd51c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue3-baidu-map-gl",
"version": "0.0.7",
"version": "0.0.8",
"main": "./dist/index.js",
"typings": "./lib/index.d.ts",
"exports": {
Expand Down
12 changes: 1 addition & 11 deletions src/components/baidu-map/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
watch(() => props.zoom, setZoom)
watch(() => props.tilt, setTilt)
watch(() => props.heading, setHeading)
watch(() => props.center, setCenter, {
watch(() => props.center, setCenterAanZoom, {
deep: true
})
watch(() => props.enableDragging, setDragging)
Expand Down Expand Up @@ -299,16 +299,6 @@
function genPoint(lng: number, lat: number): BMapGL.Point {
return new BMapGL.Point(lng, lat)
}
/**
* 设置中心点
*/
function setCenter(): void {
if (typeof props.center === 'string') {
map!.setCenter(props.center)
} else {
map!.setCenter(genPoint(props.center.lng, props.center.lat))
}
}
/**
* 设置中心点和缩放级别
*/
Expand Down

0 comments on commit 5cd51c2

Please sign in to comment.