Class: FMCompass

FMCompass

FMCompass 是指北针控件类。

new fengmap.FMCompass(option)

构造FMCompass类

Name Type Description
option Object

Object对象

Name Type Description
backgroundImageURL string

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

backgroundImageSize number

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

pointerImageURL string

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

pointerImageSize number

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

poisiton fengmap.FMControlPosition

指北针的布局位置,枚举值 fengmap.FMPOSITION,默认布局为左上角,距离边界有 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()

删除本地图控件