首页 > 解决方案 > 如何确定 HERE 中的地图类型(例如普通、卫星)?

问题描述

我需要确定当前的地图类型(普通、卫星)。在 Bing 中,这就像 map.getMapTypeId() 一样简单。

标签: javascripthere-api

解决方案


要获取地图类型,我们可以使用getBaseLayer应该返回具有type_name如下属性的对象的方法:

map.getBaseLayer().type_name; // normal, satellite

可以在此处找到文档https://developer.here.com/documentation/maps/3.1.22.1/api_reference/H.Map.html#getBaseLayer


推荐阅读