我想添加這裏通過BruTile/SharpMap將地圖貼圖映射到我的地圖。如何在BruTile/SharpMap中將地圖添加到拼貼圖層?
的URL方案是以下通過他們的文檔:
https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/13/4400/2686/256/png8
APP_ID = {YOUR_APP_ID}
&的app_code = {YOUR_APP_CODE}
其中13是縮放級別,4400是列,2686是行。
這是我的代碼,但超時了,地圖是空的。應用程序ID和應用程序代碼是正確的,它是100%確定的。可能是什麼問題?
var networkRes = Networking.HasInternetConnection();
if (networkRes.Result == false)
throw new Exception(networkRes.InfoMessage);
var uriString = "https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{z}/{x}/{y}/256/png8";
var customParams = new Dictionary<string, string>();
customParams.Add("app_id", "someappid");
customParams.Add("app_code", "someappcode");
var req = new TmsRequest(new Uri(uriString),"png" , customParams);
var provider = new WebTileProvider(req);
var tileSource = new TileSource(provider, new SphericalMercatorInvertedWorldSchema());
TileLayer tileLayer;
if (CacheWebMaps)
{
var path = Path.Combine(MapCacheRoot, HEREBASELAYERNAME);
tileLayer = new TileLayer(tileSource, HEREBASELAYERNAME, new Color(), true, path);
}
else
{
tileLayer = new TileLayer(tileSource, HEREBASELAYERNAME);
}
tileLayer.SRID = 3857;
MapBox.Map.Layers.Add(tileLayer);
在此先感謝!
您是否將其基於文檔?如果是這樣,哪個? – pauldendulk
我使用了這個文檔:https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/example-normal-day-view.html和我的代碼,我已經成功地實現了幾個瓷磚來源(osm的,MapQuest的,自定義的等),但我不能讓這裏地圖工作 – Tom
[這裏](https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/ normal.day/13/4400/2686/256/png8?app_id=xWVIueSv6JL0aJ5xqTxb&app_code=djPZyynKsbTjIUDOBcHZ2g)是您在頂部發布的具有Here地圖網站的應用ID和應用代碼的網址。它是否也會在瀏覽器中顯示您的應用程序ID和代碼? – pauldendulk