<?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 How to display a hosted feature layer within Javascript API? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-display-a-hosted-feature-layer-within/m-p/1186028#M77762</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are trying to integrate ArcGIS with our existing ASP.NET Blazor application.&lt;/P&gt;&lt;P&gt;For that, I have published a feature layer within ArcGIS Online and consuming it as a rest service within the Javascript API mapping application.&lt;/P&gt;&lt;P&gt;But the problem we are facing is, the layer is displayed on the map, whenever its sharing setting is set as "Public/Everyone", but the layer is not displayed on the map if I change the setting to "Organization".&lt;/P&gt;&lt;P&gt;Can somebody please help me figure out why this is happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2022 14:39:46 GMT</pubDate>
    <dc:creator>MatthewMinick</dc:creator>
    <dc:date>2022-06-24T14:39:46Z</dc:date>
    <item>
      <title>How to display a hosted feature layer within Javascript API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-display-a-hosted-feature-layer-within/m-p/1186028#M77762</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are trying to integrate ArcGIS with our existing ASP.NET Blazor application.&lt;/P&gt;&lt;P&gt;For that, I have published a feature layer within ArcGIS Online and consuming it as a rest service within the Javascript API mapping application.&lt;/P&gt;&lt;P&gt;But the problem we are facing is, the layer is displayed on the map, whenever its sharing setting is set as "Public/Everyone", but the layer is not displayed on the map if I change the setting to "Organization".&lt;/P&gt;&lt;P&gt;Can somebody please help me figure out why this is happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 14:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-display-a-hosted-feature-layer-within/m-p/1186028#M77762</guid>
      <dc:creator>MatthewMinick</dc:creator>
      <dc:date>2022-06-24T14:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to display a hosted feature layer within Javascript API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-display-a-hosted-feature-layer-within/m-p/1186060#M77763</link>
      <description>&lt;P&gt;If you haven't shared it publicly, then you have to use&lt;A href="https://developers.arcgis.com/javascript/latest/authenticate-with-an-arcgis-identity/" target="_self"&gt; authentication&lt;/A&gt; to gain access to them. Here's an example&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;meta name="viewport"
        content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;
    Intro to FeatureLayer | Sample | ArcGIS API for JavaScript 4.24
  &amp;lt;/title&amp;gt;

  &amp;lt;link rel="stylesheet"
        href="https://js.arcgis.com/4.24/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.24/"&amp;gt;&amp;lt;/script&amp;gt;

  &amp;lt;style&amp;gt;
    html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
  &amp;lt;/style&amp;gt;

  &amp;lt;script&amp;gt;
    require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/identity/OAuthInfo", "esri/identity/IdentityManager",], (
      Map,
      MapView,
      FeatureLayer,
      OAuthInfo,
      identityManager
    ) =&amp;gt; {
      const portalUrl = 'your portal url';
      const info = new OAuthInfo({
        appId: "your appId", //*** Your Client ID value goes here ***//
        popup: false // inline redirects don't require any additional app configuration
      });

      identityManager.registerOAuthInfos([info]);
      // send users to arcgis.com to login
      identityManager.getCredential(portalUrl);
      identityManager.checkSignInStatus(portalUrl).then(function () {
        const map = new Map({
          basemap: "hybrid"
        });

        const view = new MapView({
          container: "viewDiv",
          map: map,
          extent: {
            // autocasts as new Extent()
            xmin: -160.27,
            ymin: 18.89,
            xmax: -154.79,
            ymax: 22.26,
            spatialReference: 4326
          }
        });
        const featureLayer = new FeatureLayer({
          url: "your url"
        });
        map.add(featureLayer);
      });
    });
  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
  &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 15:20:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-display-a-hosted-feature-layer-within/m-p/1186060#M77763</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-06-24T15:20:38Z</dc:date>
    </item>
  </channel>
</rss>

