Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GeoJSONLayer使回调状态加载javascript api arcgis_Javascript_Arcgis_Arcgis Js Api - Fatal编程技术网

GeoJSONLayer使回调状态加载javascript api arcgis

GeoJSONLayer使回调状态加载javascript api arcgis,javascript,arcgis,arcgis-js-api,Javascript,Arcgis,Arcgis Js Api,我想在加载GeoJSONLayer(数据层)状态回调成功/错误时显示响应。我试了很多次,但还是没有表现出来。当加载GeoJSONLayer success/failed时,谁能给我一个回调示例,因为我想在单击按钮时禁用启用按钮状态 var geojsonLayer = new GeoJSONLayer({ url : "<?php echo $url_data_service;?>", copyright : "PEMKAB BOG

我想在加载GeoJSONLayer(数据层)状态回调成功/错误时显示响应。我试了很多次,但还是没有表现出来。当加载GeoJSONLayer success/failed时,谁能给我一个回调示例,因为我想在单击按钮时禁用启用按钮状态

var geojsonLayer = new GeoJSONLayer({
    url             : "<?php echo $url_data_service;?>",
    copyright       : "PEMKAB BOGOR",
    popupTemplate   : {
        title       : "No Register : {no_register}",
        content     : '<table class="table table-bordered table-striped"><tr><td>Nama Pemohon</td><td style="width:5px;">:</td><td>{nama_pemohon}</td></tr><tr><td>Organisasi Pemohon</td><td style="width:5px;">:</td><td>{nama_organisasi}</td></tr><tr><td>Foto</td><td style="width:5px;">:</td><td><img class="img-responsive" src="{image_source}"></td></tr><tr><td>Kecamatan</td><td style="width:5px;">:</td><td>{kecamatan}</td></tr><tr><td>Kelurahan</td><td style="width:5px;">:</td><td>{kelurahan}</td></tr></table><a style="color:white; font-weight:bold;" class="btn btn-block btn-primary" href="{permalink}">Lihat Detail</a>'
    },
    renderer        : {
        type    : "simple",
        field   : "no_register",
        symbol  : {
            type        : "simple-line",
            color       : [4, 90, 141],
            width       : 1,
            cap         : "round",
            join        : "round"
        }
    }
});

var map = new Map({
    basemap : "gray",
    layers  : [geojsonLayer]
});

var view = new MapView({
    container   : "ArcGIS",
    center      : [ 106.824651,-6.479687 ],
    zoom        : 12,
    map         : map
});

view.ui.add(
    new Expand({
        view        : view,
        content     : new BasemapGallery({view : view, container : document.createElement("div")
    })
}), "top-left");


$('.btnload').click(function(){
    var page = $(this).attr('data-href');
    $(this).prop('disabled','disabled');
    let dataLayer = new GeoJSONLayer({
        url             : "<?php echo $url_data_service;?>/" + page,
        loadStatus      : false,
        copyright       : "PEMKAB BOGOR",
        popupTemplate   : {
            title       : "No Register : {no_register}",
            content     : '<table class="table table-bordered table-striped"><tr><td>Nama Pemohon</td><td style="width:5px;">:</td><td>{nama_pemohon}</td></tr><tr><td>Organisasi Pemohon</td><td style="width:5px;">:</td><td>{nama_organisasi}</td></tr><tr><td>Foto</td><td style="width:5px;">:</td><td><img class="img-responsive" src="{image_source}"></td></tr><tr><td>Kecamatan</td><td style="width:5px;">:</td><td>{kecamatan}</td></tr><tr><td>Kelurahan</td><td style="width:5px;">:</td><td>{kelurahan}</td></tr></table><a style="color:white; font-weight:bold;" class="btn btn-block btn-primary" href="{permalink}">Lihat Detail</a>'
        },
        renderer        : {
            type    : "simple",
            field   : "no_register",
            symbol  : {
                type        : "simple-line",
                color       : [4, 90, 141],
                width       : 2,
                cap         : "round",
                join        : "round"
            }
        }
    });
    view.map.add(dataLayer);
});
var geojsonLayer=新的geojsonLayer({
url:“”,
版权所有:“PEMKAB BOGOR”,
弹出模板:{
标题:“无注册:{No_Register}”,
内容:“Nama Pemohon:{Nama_Pemohon}组织Pemohon:{Nama_Organizasi}Foto:Kecamatan:{Kecamatan}Kelurahan:{Kelurahan}”
},
渲染器:{
类型:“简单”,
字段:“无注册”,
符号:{
类型:“简单行”,
颜色:[4,90141],
宽度:1,
帽子:“圆形”,
加入:“回合”
}
}
});
var映射=新映射({
底图:“灰色”,
图层:[geojsonLayer]
});
var view=新的地图视图({
容器:“ArcGIS”,
中间:[106.824651,-6.479687],
缩放:12,
地图:地图
});
view.ui.add(
新扩展({
视图:视图,
内容:新的BasemapGallery({视图:视图,容器:document.createElement(“div”)
})
}),左上角);
$('.btnload')。单击(函数(){
var page=$(this.attr('data-href');
$(this.prop('disabled','disabled');
让dataLayer=new GeoJSONLayer({
网址:“/”+第页,
loadStatus:false,
版权所有:“PEMKAB BOGOR”,
弹出模板:{
标题:“无注册:{No_Register}”,
内容:“Nama Pemohon:{Nama_Pemohon}组织Pemohon:{Nama_Organizasi}Foto:Kecamatan:{Kecamatan}Kelurahan:{Kelurahan}”
},
渲染器:{
类型:“简单”,
字段:“无注册”,
符号:{
类型:“简单行”,
颜色:[4,90141],
宽度:2,
帽子:“圆形”,
加入:“回合”
}
}
});
view.map.add(数据层);
});
您可以使用该方法

var geojsonLayer = new GeoJSONLayer({
    url             : "<?php echo $url_data_service;?>",
    copyright       : "PEMKAB BOGOR",
    popupTemplate   : {
        title       : "No Register : {no_register}",
        content     : '<table class="table table-bordered table-striped"><tr><td>Nama Pemohon</td><td style="width:5px;">:</td><td>{nama_pemohon}</td></tr><tr><td>Organisasi Pemohon</td><td style="width:5px;">:</td><td>{nama_organisasi}</td></tr><tr><td>Foto</td><td style="width:5px;">:</td><td><img class="img-responsive" src="{image_source}"></td></tr><tr><td>Kecamatan</td><td style="width:5px;">:</td><td>{kecamatan}</td></tr><tr><td>Kelurahan</td><td style="width:5px;">:</td><td>{kelurahan}</td></tr></table><a style="color:white; font-weight:bold;" class="btn btn-block btn-primary" href="{permalink}">Lihat Detail</a>'
    },
    renderer        : {
        type    : "simple",
        field   : "no_register",
        symbol  : {
            type        : "simple-line",
            color       : [4, 90, 141],
            width       : 1,
            cap         : "round",
            join        : "round"
        }
    }
});

var map = new Map({
    basemap : "gray",
    layers  : [geojsonLayer]
});

var view = new MapView({
    container   : "ArcGIS",
    center      : [ 106.824651,-6.479687 ],
    zoom        : 12,
    map         : map
});

view.ui.add(
    new Expand({
        view        : view,
        content     : new BasemapGallery({view : view, container : document.createElement("div")
    })
}), "top-left");


$('.btnload').click(function(){
    var page = $(this).attr('data-href');
    $(this).prop('disabled','disabled');
    let dataLayer = new GeoJSONLayer({
        url             : "<?php echo $url_data_service;?>/" + page,
        loadStatus      : false,
        copyright       : "PEMKAB BOGOR",
        popupTemplate   : {
            title       : "No Register : {no_register}",
            content     : '<table class="table table-bordered table-striped"><tr><td>Nama Pemohon</td><td style="width:5px;">:</td><td>{nama_pemohon}</td></tr><tr><td>Organisasi Pemohon</td><td style="width:5px;">:</td><td>{nama_organisasi}</td></tr><tr><td>Foto</td><td style="width:5px;">:</td><td><img class="img-responsive" src="{image_source}"></td></tr><tr><td>Kecamatan</td><td style="width:5px;">:</td><td>{kecamatan}</td></tr><tr><td>Kelurahan</td><td style="width:5px;">:</td><td>{kelurahan}</td></tr></table><a style="color:white; font-weight:bold;" class="btn btn-block btn-primary" href="{permalink}">Lihat Detail</a>'
        },
        renderer        : {
            type    : "simple",
            field   : "no_register",
            symbol  : {
                type        : "simple-line",
                color       : [4, 90, 141],
                width       : 2,
                cap         : "round",
                join        : "round"
            }
        }
    });
    view.map.add(dataLayer);
});
$('.btnload')。单击(函数(){
var page=$(this.attr('data-href');
$(this.prop('disabled','disabled');
让dataLayer=new GeoJSONLayer({
网址:“/”+第页,
loadStatus:false,
版权所有:“PEMKAB BOGOR”,
弹出模板:{
标题:“无注册:{No_Register}”,
内容:“Nama Pemohon:{Nama_Pemohon}组织Pemohon:{Nama_Organizasi}Foto:Kecamatan:{Kecamatan}Kelurahan:{Kelurahan}”
},
渲染器:{
类型:“简单”,
字段:“无注册”,
符号:{
类型:“简单行”,
颜色:[4,90141],
宽度:2,
帽子:“圆形”,
加入:“回合”
}
}
});
dataLayer.when(函数(){
//成功
$('.btnload').prop('disabled','');
},函数(){
//错误
$('.btnload').prop('disabled','');
});
view.map.add(数据层);
});