Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d367ea52
authored
Jan 16, 2025
by
huyue
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复查看定位问题
1 parent
236ad9ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
src/components/amap/index.vue
src/main.js
src/components/amap/index.vue
View file @
d367ea5
...
@@ -33,34 +33,26 @@ export default {
...
@@ -33,34 +33,26 @@ export default {
return
{
return
{
mapObj
:
""
,
mapObj
:
""
,
zoom
:
12
,
zoom
:
12
,
mapapi
:
""
,
};
};
},
},
crea
ted
()
{
moun
ted
()
{
this
.
initMap
();
this
.
initMap
();
console
.
log
(
'地图'
);
console
.
log
(
'地图'
);
},
},
methods
:
{
methods
:
{
async
initMap
()
{
async
initMap
()
{
// console.log(GLMapSdk);
try
{
try
{
new
GLMapSdk
(
async
(
mapapi
)
=>
{
//
new GLMapSdk(async (mapapi) => {
this
.
mapapi
=
mapapi
;
console
.
log
(
this
.
mapapi
,
'mapapi'
)
;
console
.
log
(
mapapi
,
'mapapi'
);
const
mapapi
=
this
.
mapapi
const
map
=
await
mapapi
.
invoke
(
"Map"
,
"mapContainer"
);
const
map
=
await
mapapi
.
invoke
(
"Map"
,
"mapContainer"
);
const
{
lng
,
lat
}
=
this
.
info
;
const
{
lng
,
lat
}
=
this
.
info
;
mapapi
.
invoke
(
"centerAndZoom"
,
mapapi
.
invoke
(
"Point"
,
lng
,
lat
),
this
.
zoom
);
mapapi
.
invoke
(
"centerAndZoom"
,
mapapi
.
invoke
(
"Point"
,
lng
,
lat
),
this
.
zoom
);
//向地图中添加缩放控件
// var ctrlNav = new window.BMap.NavigationControl({
// anchor: BMAP_ANCHOR_TOP_LEFT,
// type: BMAP_NAVIGATION_CONTROL_LARGE,
// });
//地图缩放控件
// map.addControl(ctrlNav);
// mapapi.invoke('addControl', ctrlNav)
mapapi
.
invoke
(
'NavigationControl'
)
mapapi
.
invoke
(
'NavigationControl'
)
// mapapi.invoke('enableScrollWheelZoom')
// mapapi.invoke('enableScrollWheelZoom')
this
.
drawMaker
(
mapapi
,
map
);
this
.
drawMaker
(
mapapi
,
map
);
});
// })
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
}
}
...
...
src/main.js
View file @
d367ea5
...
@@ -12,6 +12,8 @@ import { Common } from '@/utils/common.js'
...
@@ -12,6 +12,8 @@ import { Common } from '@/utils/common.js'
import
Constants
from
'@/utils/constants.js'
import
Constants
from
'@/utils/constants.js'
import
actions
from
'@/core/actions'
;
import
actions
from
'@/core/actions'
;
import
GlsxDialog
from
"@/components/dialog"
;
import
GlsxDialog
from
"@/components/dialog"
;
import
GlMapSdk
from
"@/utils/glsk-mapapi-sdk"
;
console
.
log
(
GlMapSdk
);
// import axios from 'axios'
// import axios from 'axios'
Vue
.
component
(
'glsx-dialog'
,
GlsxDialog
)
Vue
.
component
(
'glsx-dialog'
,
GlsxDialog
)
Vue
.
prototype
.
btn_size
=
'mini'
Vue
.
prototype
.
btn_size
=
'mini'
...
@@ -20,7 +22,7 @@ Vue.prototype.$Constants = Constants
...
@@ -20,7 +22,7 @@ Vue.prototype.$Constants = Constants
Vue
.
use
(
VueRouter
);
Vue
.
use
(
VueRouter
);
Vue
.
use
(
ElementUI
)
Vue
.
use
(
ElementUI
)
Vue
.
config
.
productionTip
=
false
;
Vue
.
config
.
productionTip
=
false
;
Vue
.
prototype
.
mapapi
=
new
GlMapSdk
()
let
router
=
null
;
let
router
=
null
;
let
instance
=
null
;
let
instance
=
null
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment