1
我正在學習如何使用谷歌地圖API,和我想要實現一個熱圖,下面this教程,但他們的代碼有一個readItems()方法我不能」找出從那裏它正在添加。谷歌地圖Android的熱圖實用教程 - 無法解析方法
list = readItems(R.raw.police_stations);
我一直在爲此掙扎了一天半。 凡本methos從正在添加?
謝謝
private void addHeatMap() {
List<LatLng> list = null;
// Get the data: latitude/longitude positions of police stations.
try {
list = readItems(R.raw.police_stations);
} catch (JSONException e) {
Toast.makeText(this, "Problem reading list of locations.", Toast.LENGTH_LONG).show();
}
// Create a heat map tile provider, passing it the latlngs of the police stations.
mProvider = new HeatmapTileProvider.Builder()
.data(list)
.build();
// Add a tile overlay to the map, using the heat map tile provider.
mOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(mProvider));
}