地图选项 最后更新时间: 2021年01月22日
地图选项
Option | Type | Default | AllowEmpty | Description |
---|---|---|---|---|
key | String | null | no | 申请JSAPI的开发者key, 申请地址:https://lbs.amap.com/dev/key 注:key需要绑定Web服务API |
buildingId | String | null | no | 建筑物ID. |
floor | Number | null | yes | 地图加载指定的楼层 |
zoom | Number | null | yes | 地图加载指定的层级 |
floorControl | Boolean | true | yes | 是否显示楼层控件 |
detailTipControl | Boolean | true | yes | 是否显示详情tip控件,pc端显示在水滴图标上, mo单独显示在页脚. |
searchBarControl | Boolean | true | yes | 是否显示搜索控件 |
routeControl | Boolean | true | yes | 是否显示路算控件 |
zoomControl | Boolean | true | yes | 是否显示载 放大/缩小控件 |
imagePath | String | images | yes | 图片资源路径,默认和jsapi在相同路径下的images目录 |
highlightFeatrueClick | Boolean | false | yes | 点击商铺后是否高亮显示 |
renderColors | Array [object] | null | yes | 自定义颜色渲染,见下面示例 |
indoorExtra | String | null | yes | 自定义标识字符串,通过标识来实现自定义统计, 注:字符串中不要带&和=字符, 通过KEY:VAULE的形式传递多组字段和内容, 例:KEY1:VAULE1;KEY2:VAULE2 |
示例代码
//示例 初始化地图
var map = new Indoor.Map('container',{
key:'开发者key',
buildingId:'建筑物ID',
renderColors:{
defaultFontColor:'red', //显示文字颜色
shopHightLightStyle:{ //点击高亮商铺样式
'fillColor': '#fffdf8',
'color': '#d1ccc0',
'weight': 1,
'fillOpacity': 1,
'opacity': 1,
'fontColor':'red'
},
shopStyle:[
//楼层面样式
{ typeCode: 'floor', style: { 'fillColor': 'red', 'color': 'red', 'fontColor':'#d1ccc0' } },
//商铺分类配色,根据ft_typecode的前2位
{ typeCode: '98,05', style: { 'fillColor': 'red', 'color': 'red', 'fontColor':'#d1ccc0' } },
//中空、非开放区域配色
{ typeCode: '00', style: { 'fillColor': 'red', 'color': 'red', 'fontColor':'#d1ccc0' } },
//根据ft_sourceid配色
{ id: '49130210100059', style: { 'fillColor': 'red', 'color': 'red', 'fontColor':'#000000' } },
]
}
});