<?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 Re: Using map components - how to set spatialReferenceLocked on view in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-map-components-how-to-set/m-p/1659559#M87741</link>
    <description>&lt;P&gt;To fix this issue, update to v4.34.x of map-components. A new property has been added to ArcgisMap that allows you to lock the spatial reference. Line 41 of the code in the original post should read:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.arcgisMap.spatialReferenceLocked = true;&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 22 Oct 2025 10:13:08 GMT</pubDate>
    <dc:creator>AJasper</dc:creator>
    <dc:date>2025-10-22T10:13:08Z</dc:date>
    <item>
      <title>Using map components - how to set spatialReferenceLocked on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-map-components-how-to-set/m-p/1647362#M87574</link>
      <description>&lt;P&gt;I'm using arcgis/map-components in my app and I'm having a bit of a problem setting the&amp;nbsp;spatialReferenceLocked of the map view. See code below (TypeScript/Angular).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const sr = new SpatialReference({
      wkid: 27700,
    });

    this.arcgisMap = this.mapViewElement?.nativeElement as ArcgisMap;

    let baseLayer: Layer;

    if (environment.baseLayerType === 'VectorTileLayer') {
      baseLayer = new VectorTileLayer({
        url: environment.baseMapUrl,
        title: 'Great Britain',
      });
    } else {
      baseLayer = new TileLayer({
        url: environment.baseMapUrl,
        title: 'Great Britain',
      });
    }

    const extent = new Extent({
      xmin: -100000,
      ymin: -30000,
      xmax: 710000,
      ymax: 1250000,
      spatialReference: sr.clone(),
    });

    const map = new Map({
      basemap: new Basemap({
        baseLayers: [baseLayer],
        spatialReference: sr.clone(),
      }),
    });

    this.arcgisMap.extent = extent;
    this.arcgisMap.constraints.maxScale = 0;
    this.arcgisMap.constraints.lods = TileInfo.create({
      spatialReference: extent.spatialReference.clone(),
    }).lods;
    this.arcgisMap.view.spatialReferenceLocked = true;

    this.arcgisMap.map = map;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;On line 41 where the spatialReferenceLocked property is being set to true (filters out basemaps as using basemap gallery) it errors with the error&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[esri.core.Accessor] cannot assign to construct-only property 'spatialReferenceLocked'&lt;/LI-CODE&gt;&lt;P&gt;I cannot figure out how I set this property, any help would be greatly appreaciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 15:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-map-components-how-to-set/m-p/1647362#M87574</guid>
      <dc:creator>AJasper</dc:creator>
      <dc:date>2025-09-02T15:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using map components - how to set spatialReferenceLocked on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-map-components-how-to-set/m-p/1659559#M87741</link>
      <description>&lt;P&gt;To fix this issue, update to v4.34.x of map-components. A new property has been added to ArcgisMap that allows you to lock the spatial reference. Line 41 of the code in the original post should read:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.arcgisMap.spatialReferenceLocked = true;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Oct 2025 10:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-map-components-how-to-set/m-p/1659559#M87741</guid>
      <dc:creator>AJasper</dc:creator>
      <dc:date>2025-10-22T10:13:08Z</dc:date>
    </item>
  </channel>
</rss>

