<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic get initialExtent instead of fullextent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1528551#M85511</link>
    <description>&lt;P&gt;I don't understand why the initial extent is not available to build a map on a MapImageLayer ? only fullextent is available&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var mapImageLayer = new MapImageLayer({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;url: "URL_DU_MAP_IMAGE_LAYER"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;mapImageLayer.load().then(function() {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;// Obtenir l'étendue initiale du MapImageLayer&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var initialExtent = mapImageLayer.initialExtent;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;console.log("Étendue initiale du MapImageLayer : ", initialExtent);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Créer la vue de la carte en utilisant l'étendue initiale&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var map = new Map({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;basemap: "streets",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;layers: [mapImageLayer]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var view = new MapView({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;container: "viewDiv", // ID de l'élément HTML où la carte sera affichée&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;map: map,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;extent: initialExtent&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}).catch(function(error) {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;console.error("Erreur lors du chargement du MapImageLayer : ", error);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the only solution is used the rest api with ?f=json&lt;/P&gt;&lt;P&gt;Thanks for your explanation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Wed, 28 Aug 2024 10:33:24 GMT</pubDate>
    <dc:creator>LionelGOUBET</dc:creator>
    <dc:date>2024-08-28T10:33:24Z</dc:date>
    <item>
      <title>get initialExtent instead of fullextent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1528551#M85511</link>
      <description>&lt;P&gt;I don't understand why the initial extent is not available to build a map on a MapImageLayer ? only fullextent is available&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var mapImageLayer = new MapImageLayer({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;url: "URL_DU_MAP_IMAGE_LAYER"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;mapImageLayer.load().then(function() {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;// Obtenir l'étendue initiale du MapImageLayer&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var initialExtent = mapImageLayer.initialExtent;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;console.log("Étendue initiale du MapImageLayer : ", initialExtent);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Créer la vue de la carte en utilisant l'étendue initiale&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var map = new Map({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;basemap: "streets",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;layers: [mapImageLayer]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var view = new MapView({&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;container: "viewDiv", // ID de l'élément HTML où la carte sera affichée&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;map: map,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;extent: initialExtent&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}).catch(function(error) {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;console.error("Erreur lors du chargement du MapImageLayer : ", error);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the only solution is used the rest api with ?f=json&lt;/P&gt;&lt;P&gt;Thanks for your explanation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Aug 2024 10:33:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1528551#M85511</guid>
      <dc:creator>LionelGOUBET</dc:creator>
      <dc:date>2024-08-28T10:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: get initialExtent instead of fullextent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1528826#M85513</link>
      <description>&lt;P&gt;The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html" target="_self"&gt;MapImageLayer&lt;/A&gt; class doesn't expose an initialExtent property, but the value can still be retrieved from its &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sourceJSON" target="_self"&gt;sourceJSON&lt;/A&gt; property.&amp;nbsp; See line 7 below, which also uses &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#fromJSON" target="_self"&gt;Extent.fromJSON&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var mapImageLayer = new MapImageLayer({
	url: "URL_DU_MAP_IMAGE_LAYER"
});

mapImageLayer.load().then(function() {
	// Obtenir l'étendue initiale du MapImageLayer
	var initialExtent = Extent.fromJSON(mapImageLayer.sourceJSON.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);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 17:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1528826#M85513</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-08-28T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: get initialExtent instead of fullextent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1529189#M85521</link>
      <description>&lt;P&gt;Thanks Joel &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... I missed it &lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 06:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-initialextent-instead-of-fullextent/m-p/1529189#M85521</guid>
      <dc:creator>LionelGOUBET</dc:creator>
      <dc:date>2024-08-29T06:44:25Z</dc:date>
    </item>
  </channel>
</rss>

