I don't understand why the initial extent is not available to build a map on a MapImageLayer ? only fullextent is available
var mapImageLayer = new MapImageLayer({
url: "URL_DU_MAP_IMAGE_LAYER"
});
mapImageLayer.load().then(function() {
// Obtenir l'étendue initiale du MapImageLayer
var initialExtent = mapImageLayer.initialExtent;
console.log("Étendue initiale du MapImageLayer : ", initialExtent);
// Créer la vue de la carte en utilisant l'étendue initiale
var map = new Map({
basemap: "streets",
layers: [mapImageLayer]
});
var view = new MapView({
container: "viewDiv", // ID de l'élément HTML où la carte sera affichée
map: map,
extent: initialExtent
});
}).catch(function(error) {
console.error("Erreur lors du chargement du MapImageLayer : ", error);
});
the only solution is used the rest api with ?f=json
Thanks for your explanation