Class: FMMiniMap

FMMiniMap

FMMiniMap 小地图类,属于 fengmap.plugin.first.min.js

new fengmap.FMMiniMap(options)

Name Type Description
options Object

参数集合

Name Type Description
container Document

地图容器 必填

ctrl number

fengmap.FMFirstPersonControl对象 必填

floorExternalModels Object

示例:{typeIDs: [...],FIDs: [...]},作为地板的外部模型FID或typeID,一旦设置,这个外部模型更清晰,始终在下面。

hideExternalModels Object

示例:{typeIDs: [...],FIDs: [...]},小地图上不渲染外部模型FID或typeID。

mapZoom number

初始化的zoom值,注:displayMode为fengmap.FMDisplayMode.HAWKEYE鹰眼模式有效

locationOptions Object

定位标志的配置

Name Type Description
url number

定位标志url,默认一个蓝色箭头

size number

定位标志的大小,默认32

rotation number

初始化小地图旋转

displayMode fengmap.FMDisplayMode

小地图显示模式,fengmap.FMDisplayMode.HAWKEYE鹰眼模式,fengmap.FMDisplayMode.OVERVIEW全览模式,默认为FMDisplayMode.HAWKEYE(鹰眼)

Members

displayMode

Properties:
Name Type Description
displayMode fengmap.FMDisplayMode

显示模式

visible

Properties:
Name Type Description
visible bool

显示隐藏

Methods

addMarker(marker)

添加覆盖物到小地图中

Name Type Description
marker fengmap.FMLocationMarker | fengmap.FMLineMarker

marker对象

dispose()

销毁小地图对象,注:只销毁小地图,不会删除小地图容器div

getRotation(){number}

获取小地图旋转角度

Returns:
Type Description
number 小地图旋转角度

getZoom(){number}

获取地图当前缩放级别

Returns:
Type Description
number 缩放级别

off(type, callback)

地图事件注销

Name Type Description
type string

事件类型

callback function

回调函数

on(type, callback)

地图事件注册

Name Type Description
type string

事件类型

callback function

回调函数

resize(w, h)

设置小地图尺寸,注只修改小地图,容器如div修改尺寸需要用户自己修改

Name Type Description
w number

小地图宽度,单位像素

h number

小地图高度,单位像素

setRotation(angle)

设置小地图旋转角度

Name Type Description
angle number

旋转角度

setZoom(zoom)

缩放小地图到指定级别

Name Type Description
zoom number

小地图缩放级别

Events

click

鼠标点击事件

Name Type Description
event Object

事件返回参数

Name Type Description
coords object

点击到的地图坐标