Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
my-map
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭铭瑶
my-map
Commits
5c0ff280
Commit
5c0ff280
authored
Aug 10, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
my-map提取默认数据
parent
02f564cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
81 deletions
+92
-81
my-map.ts
src/my-map/my-map.ts
+85
-81
types.ts
src/my-map/types.ts
+7
-0
No files found.
src/my-map/my-map.ts
View file @
5c0ff280
...
...
@@ -10,15 +10,7 @@ import {
LayerOption
,
}
from
'./types'
export
default
abstract
class
MyMap
{
protected
map
protected
_listeners
:
Listeners
protected
_controls
:
Controls
protected
_layers
:
Layers
constructor
(
instance
:
any
)
{
this
.
map
=
instance
this
.
_listeners
=
{
const
defaultListeners
=
{
load
:
(
cb
:
CallBack
)
=>
{
console
.
error
(
'on:此地图不存在 load 监听事件!'
)
},
...
...
@@ -49,8 +41,9 @@ export default abstract class MyMap {
mousewheel
:
(
cb
:
CallBack
)
=>
{
console
.
error
(
'on:此地图不存在 mousewheel 监听事件!'
)
},
}
this
.
_controls
=
{
}
const
defaultControls
=
{
home
:
()
=>
{
console
.
error
(
'set:此地图不存在 home 控件!'
)
},
...
...
@@ -87,11 +80,22 @@ export default abstract class MyMap {
bMapGalleryexpand
:
()
=>
{
console
.
error
(
'set:此地图不存在 bMapGalleryexpand 控件!'
)
},
}
this
.
_layers
=
{
}
const
defaultLayers
=
{
point
:
()
=>
console
.
error
(
'add:此地图不存在 point 覆盖物!'
),
line
:
()
=>
console
.
error
(
'add:此地图不存在 line 覆盖物!'
),
}
polygon
:
()
=>
console
.
error
(
'add:此地图不存在 polygon 覆盖物!'
),
}
export
default
abstract
class
MyMap
{
protected
map
protected
_listeners
:
Listeners
=
defaultListeners
protected
_controls
:
Controls
=
defaultControls
protected
_layers
:
Layers
=
defaultLayers
constructor
(
instance
:
any
)
{
this
.
map
=
instance
}
/**
...
...
@@ -137,24 +141,24 @@ export default abstract class MyMap {
* zoom in
* @param options 参数
*/
abstract
zoomIn
(
options
?:
ZoomOptions
):
unknown
abstract
zoomIn
(
options
?:
ZoomOptions
):
void
/**
* zoom out
* @param options 参数
*/
abstract
zoomOut
(
options
?:
ZoomOptions
):
unknown
abstract
zoomOut
(
options
?:
ZoomOptions
):
void
/**
* zoom to
* @param level 等级
* @param options 参数
*/
abstract
zoomTo
(
level
:
number
,
options
?:
ZoomOptions
):
unknown
abstract
zoomTo
(
level
:
number
,
options
?:
ZoomOptions
):
void
/**
* 聚焦
* @param location 坐标
* @param options 参数
*/
abstract
focus
(
location
:
Location
,
options
?:
FocusOptions
):
unknown
abstract
focus
(
location
:
Location
,
options
?:
FocusOptions
):
void
/**
* 移除覆盖物
...
...
src/my-map/types.ts
View file @
5c0ff280
...
...
@@ -143,6 +143,10 @@ export interface Controls {
bMapGallery
:
(
options
?:
ControlOptions
)
=>
void
bMapGalleryexpand
:
(
options
?:
ControlOptions
)
=>
void
}
/**
* zoom配置参数(维智地图用)
*/
export
interface
ZoomOptions
{
/** 如果 false ,则没有动画效果(默认true) */
animate
?:
boolean
...
...
@@ -154,6 +158,9 @@ export interface ZoomOptions {
offset
?:
[
number
,
number
]
}
/**
* focus配置参数(测绘院地图只有zoom有用)
*/
export
interface
FocusOptions
{
/**地图缩放等级(默认当前等级) */
zoom
?:
number
...
...
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