【问题标题】:read .mbtiles files into leaflet.js将.mbtiles 文件读入leaflet.js
【发布时间】:2013-01-22 15:25:58
【问题描述】:

我们正在构建 phonegap 应用程序,我们希望使用 Leaflet.js v 0.5 在其中放置地图 我们尝试通过 SQLitePlugin 读取 .mbtiles 文件

https://github.com/chbrody/Cordova-SQLitePlugin

函数 buildMap() { var db = window.sqlitePlugin.openDatabase("file:///sdcard/one_tile.mbtiles"); document.body.removeChild(msg);

  var map = new L.Map('map', {
      center: new L.LatLng(40.6681, -111.9364),
      zoom: 11
  });

  var lyr = new L.TileLayer.MBTiles('', {maxZoom: 14, scheme: 'tms'}, db);

  map.addLayer(lyr);
}

但是 sqlitePlugin.openDatabase 没有找到 .mbtiles 文件

【问题讨论】:

    标签: cordova leaflet


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      您可以查看 florianfournier 的 Cordova 插件,该插件可以开箱即用地读取 MBTiles 磁贴:https://github.com/ffournier/cordova-plugin-mbtiles

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-01-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-06-25
        相关资源
        最近更新 更多