Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error, Property 'mbTiles' does not exist on type 'typeof tileLayer' with ionic cordova angular #10

Open
skelvin opened this issue Jan 31, 2024 · 0 comments

Comments

@skelvin
Copy link

skelvin commented Jan 31, 2024

I am trying to integrate leaflet-tilelayer-mbtiles-ts into my ionic project but im getting an error Property 'mbTiles' does not exist on type 'typeof tileLayer' with ionic cordova angular

cordova: 12.0.0
ionic: 7.1.1
"leaflet" : "^1.7.1",
"leaflet-tilelayer-mbtiles-ts": "^1.5.6",
"@types/leaflet": "^1.5.19",

page.ts

``
import * as L from 'leaflet';
import "leaflet-tilelayer-mbtiles-ts";

@component({
selector: 'app-test-page',
templateUrl: './test-page.page.html',
styleUrls: ['./test-page.page.scss'],
})
export class TestPagePage implements OnInit {
public map : L.Map;

private async initMap() {
this.map = new L.Map('map_canvas');

this.map.on('load', (event:any) => {
  this.map.locate({
    watch:false,
    setView:true,
    maxZoom:17,
    enableHighAccuracy:true,
  });

  var iconOptions = {
    iconUrl: 'assets/maps/gps-location.svg',
  }
  var customIcon = L.icon(iconOptions);
  var markerOptions = {
    clickable: false,
    draggable: true,
    icon: customIcon
 }

  L.marker([this.latitude, this.longitude], markerOptions).addTo(this.map);
});

this.map.setView([1.76934, 32.64209], 6);
      const mb = L.tileLayer.mbTiles('/azc/offlinemaps/ke.mbtiles', {
        minZoom: 0,
        maxZoom: 6
      }).addTo(this.map);

}
}
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant