簡體   English   中英

MapBox MapView在屏幕中重復填充

[英]MapBox mapview repeat padding in screen

我使用MapBox Android SDK 0.7.2從MapBox Web服務獲取切片:

    WebSourceTileLayer webSourceTileLayer = new WebSourceTileLayer("MapBox", "http://api.tiles.mapbox.com/v4/examples.map-zr0njcqy/-73.99,40.70,13/256x256.png?access_token=<my key>");

    webSourceTileLayer.setName("MapBox")
            .setAttribution("© MapBox © OpenStreetMap")
            .setMinimumZoomLevel(1)
            .setMaximumZoomLevel(18);
    mapView.setTileSource(webSourceTileLayer);

    mapView.setZoom(12);
    mapView.setCenter(mapView.getTileProvider().getCenterCoordinate());

所以我得到了一個256x256 png格式的圖塊 但是我想它應該是屏幕上的一個圖塊,但在屏幕上會重復顯示圖塊。 任何建議表示贊賞。

您是否只是想從Mapbox Web Service API下載一個圖塊? 如果是這樣,請使用常規的Android HTTP客戶端(例如:URLConnnection類)下載它,然后在Canvas上進行繪制,這樣做會更好。 像WebSourceTileLayer這樣的TileLayers旨在下載許多不同的圖塊,並按照所述方式將它們顯示在MapView上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM