<?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 BasemapGallery how to set source from my URL in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206011#M78435</link>
    <description>&lt;P&gt;How can I set the objects I want from my url to BasemapGallery&amp;nbsp; and not those that are in it initially from default?&lt;/P&gt;&lt;P&gt;Project Angular ASP NET6.&amp;nbsp;I am using the object&amp;nbsp; const world = new WMSLayer({&amp;nbsp;url: "my Url "});&amp;nbsp;&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt;ground: "world-elevation",&lt;BR /&gt;layers: [world]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const container = this.mapViewEl.nativeElement;&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container,&lt;BR /&gt;map: map&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const basemapGallery = new BasemapGallery({&lt;BR /&gt;view: view&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;view.ui.add(basemapGallery, "top-right"); // Add to the view&lt;/P&gt;&lt;P&gt;How to set new my source to&amp;nbsp;BasemapGallery?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 18:59:25 GMT</pubDate>
    <dc:creator>DimaY</dc:creator>
    <dc:date>2022-08-24T18:59:25Z</dc:date>
    <item>
      <title>BasemapGallery how to set source from my URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206011#M78435</link>
      <description>&lt;P&gt;How can I set the objects I want from my url to BasemapGallery&amp;nbsp; and not those that are in it initially from default?&lt;/P&gt;&lt;P&gt;Project Angular ASP NET6.&amp;nbsp;I am using the object&amp;nbsp; const world = new WMSLayer({&amp;nbsp;url: "my Url "});&amp;nbsp;&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt;ground: "world-elevation",&lt;BR /&gt;layers: [world]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const container = this.mapViewEl.nativeElement;&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container,&lt;BR /&gt;map: map&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const basemapGallery = new BasemapGallery({&lt;BR /&gt;view: view&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;view.ui.add(basemapGallery, "top-right"); // Add to the view&lt;/P&gt;&lt;P&gt;How to set new my source to&amp;nbsp;BasemapGallery?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 18:59:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206011#M78435</guid>
      <dc:creator>DimaY</dc:creator>
      <dc:date>2022-08-24T18:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: BasemapGallery how to set source from my URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206129#M78436</link>
      <description>&lt;P&gt;Hi, you can add your own basemaps via the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source" target="_self"&gt;source&lt;/A&gt; property of the BasemapGallery. Something like this:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const world = new WMSLayer({ url: "my Url "});
// create a basemap with your WMS layer as the base layer
const worldBasemap = new Basemap({
  baseLayers: [world]
});

const basemapGallery = new BasemapGallery({
   view: view,
   // set the source to an array of basemaps
   //   here we are including the worldBasemap from your WMSLayer
   //   and the Esri hybrid basemap
   source: [worldBasemap, Basemap.fromId("hybrid")]
});
view.ui.add(basemapGallery, "top-right");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 22:23:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206129#M78436</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2022-08-24T22:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: BasemapGallery how to set source from my URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206263#M78440</link>
      <description>&lt;P&gt;First of all, thank you very much for your reply!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please tell me what is in your code view? I had a MapView with that view name. What do you have?&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your code Basemap.fromId("hybrid") where did you define it - Basemap?&amp;nbsp;Why am I asking? Because you defined this const worldBasemap = new Basemap({&lt;BR /&gt;baseLayers: [world]&lt;BR /&gt;});&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;As a programmer, I got the idea that I should define a new Basemap object&amp;nbsp;in which I should insert and define property baseLayers , which in turn, I will take from WMSLayer, in which, in turn, I will insert my URL.&amp;nbsp;Something like that, yes?&lt;/P&gt;&lt;P&gt;And thank you very much, you helped me a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 09:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206263#M78440</guid>
      <dc:creator>DimaY</dc:creator>
      <dc:date>2022-08-25T09:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: BasemapGallery how to set source from my URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206983#M78461</link>
      <description>&lt;P&gt;Here is an example of my code and it doesn't work, what is done wrong? Thank you!&lt;/P&gt;&lt;P&gt;import {&lt;BR /&gt;Component,&lt;BR /&gt;OnInit,&lt;BR /&gt;ViewChild,&lt;BR /&gt;ElementRef,&lt;BR /&gt;OnDestroy,&lt;BR /&gt;} from '@angular/core';&lt;/P&gt;&lt;P&gt;import Map from '@arcgis/core/Map';&lt;BR /&gt;import Basemap from "@arcgis/core/Basemap";;&lt;BR /&gt;import SceneView from '@arcgis/core/views/SceneView';&lt;BR /&gt;import WMSLayer from '@arcgis/core/layers/WMSLayer';&lt;BR /&gt;import BasemapGallery from "@arcgis/core/widgets/BasemapGallery";&lt;/P&gt;&lt;P&gt;@Component({&lt;BR /&gt;selector: 'app-root',&lt;BR /&gt;templateUrl: './app.component.html',&lt;BR /&gt;styleUrls: ['./app.component.css'],&lt;BR /&gt;})&lt;BR /&gt;export class AppComponent implements OnInit, OnDestroy {&lt;BR /&gt;public view: any = null;&lt;/P&gt;&lt;P&gt;// The &amp;lt;div&amp;gt; where we will place the map&lt;BR /&gt;@ViewChild('mapViewNode', { static: true }) private mapViewEl!: ElementRef;&lt;/P&gt;&lt;P&gt;initializeMap(): Promise&amp;lt;any&amp;gt; {&lt;/P&gt;&lt;P&gt;const world = new WMSLayer({&lt;BR /&gt;url: "example my geoserver url",&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;const map = new Map({&lt;BR /&gt;ground: "world-elevation",&lt;BR /&gt;layers: [world]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const container = this.mapViewEl.nativeElement;&lt;/P&gt;&lt;P&gt;const view = new SceneView({&lt;BR /&gt;container,&lt;BR /&gt;map: map&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const worldBasemap = new Basemap({&lt;BR /&gt;baseLayers: [world]&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;const basemapGallery = new BasemapGallery({&lt;BR /&gt;view: view,&lt;BR /&gt;source: [worldBasemap]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;view.ui.add(basemapGallery, "top-right"); // Add to the view&lt;/P&gt;&lt;P&gt;this.view = view;&lt;BR /&gt;return this.view.when();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;ngOnInit(): any {&lt;BR /&gt;this.initializeMap().then(() =&amp;gt; {&lt;BR /&gt;console.log('The map is ready.');&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;ngOnDestroy(): void {&lt;BR /&gt;if (this.view) {&lt;BR /&gt;this.view.destroy();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2022 09:51:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1206983#M78461</guid>
      <dc:creator>DimaY</dc:creator>
      <dc:date>2022-08-27T09:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: BasemapGallery how to set source from my URL</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1207260#M78473</link>
      <description>&lt;P&gt;&lt;EM&gt;Please tell me what is in your code view? I had a MapView with that view name. What do you have?&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I was using a MapView. But either MapView or SceneView should work.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In your code Basemap.fromId("hybrid") where did you define it - Basemap?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This is an API class "esri/Basemap" that I imported at the name time as my MapView and BasemapGallery: &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;As a programmer, I got the idea that I should define a new Basemap object&amp;nbsp;in which I should insert and define property baseLayers , which in turn, I will take from WMSLayer, in which, in turn, I will insert my URL.&amp;nbsp;Something like that, yes?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Yes, that sounds about right!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 15:29:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemapgallery-how-to-set-source-from-my-url/m-p/1207260#M78473</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2022-08-29T15:29:47Z</dc:date>
    </item>
  </channel>
</rss>

