ionic show 中的传单地图总是显示行程,show:false 不起作用

Leaflet map in ionic show always show itineray, show:false doesnt work

我正在使用 Ionic Cordova 处理地图,绘制两点之间的路线。 一切正常,除了我无法隐藏行程(gps 给出的方向)并且在小型智能手机行程中不允许用户与地图交互。 我用谷歌搜索了例子,但我发现我的代码没有什么不同。

this.geolocation.getCurrentPosition().then(resp=>{
        this.localizacion = resp.coords;
        this.posicion = [this.localizacion.latitude, this.localizacion.longitude];

        this.map = leaflet.map('map', {
          center: this.posicion,
          zoom: 16
        });
        leaflet.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
          attribution: '© Código 200'
        }).addTo(this.map);
        let control = leaflet.Routing.control({
            waypoints: [
                leaflet.latLng(this.localizacion.latitude, this.localizacion.longitude),
                leaflet.latLng(result[0].latitude, result[0].longitude)
            ],
            routeWhileDragging: true, 
            show: false
        }).addTo(this.map

        let markerGroup = leaflet.featureGroup();
        let marker: any = leaflet.marker(this.center);
        markerGroup.addLayer(marker);
        let marker2: any = leaflet.marker(this.posicion);
        markerGroup.addLayer(marker2);

        this.map.addLayer(markerGroup);
});

如果我做错了什么,有人能告诉我吗??或另一种隐藏行程的方法

好吧,我可以修复它,将在线 css feaflet 使用和自定义 css 混合到我的项目中,我在其中添加了 show:fakse 和我需要的所有内容。