Class: FMCompass

FMCompass

FMCompass 是指北针控件类。 属于fengmap.plugins.min.js

new fengmap.FMCompass(option)

构造FMCompass类, 依赖样式文件 toolBarStyle.css

Name Type Description
option Object

Object对象,该设置的优先级大于样式文件的优先级

Name Type Description
backgroundImageURL string

指北针的背景图地址,选填项

backgroundImageSize number

指北针的背景图尺寸,默认为50px

pointerImageURL string

指北针的指针图片地址,选填项

pointerImageSize number

指北针的指针尺寸,默认为50px

position fengmap.FMControlPosition

指北针的布局位置,枚举值 fengmap.FMControlPosition,默认布局为左上角,距离边界有 10px 的偏移

offset Object

指北针所在位置{x:number,y:number},默认距离边界有 10px 的偏移

Methods

addTo(map地图对象)

将地图加入控件中

Name Type Description
map地图对象 map

on(type, function)

为指北针点击事件注册事件

Name Type Description
type string

注册事件类型click

function callback

调用点击事件后的返回函数

remove()

删除本地图控件