Select to view content in your preferred language

Using custom basemaps

943
4
Jump to solution
11-13-2017 12:17 PM
NachiChidambaram
Occasional Contributor

I created a following basemap in arcgis online using mapbox : https://arcg.is/1zf5qz 

I want to use this map as a basemap in my application. 

I am trying to follow this example here ArcGIS API for JavaScript Sandbox 

The mapBaseLayer urlTemplate  contains a  http://~xxx.png .  Not sure how to use the arcgis online custom maps in arcgis api 4.5

Do I need a png from arcgis online to use my map . If so can you provide an example ?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Esri Frequent Contributor

Basemaps are WebMaps, so you can add it like this.

  const map = new EsriMap({
    basemap: {
      portalItem: {
        id: "b74e3eeef31942869c1f611f341ce8ed"
      }
    }
  });

Here is a sample.

https://codepen.io/odoe/pen/EbvPPg 

View solution in original post

0 Kudos
4 Replies
NachiChidambaram
Occasional Contributor

I think i figured out the answer. Thanks . Will post it soon.

0 Kudos
ReneRubalcava
Esri Frequent Contributor

Basemaps are WebMaps, so you can add it like this.

  const map = new EsriMap({
    basemap: {
      portalItem: {
        id: "b74e3eeef31942869c1f611f341ce8ed"
      }
    }
  });

Here is a sample.

https://codepen.io/odoe/pen/EbvPPg 

0 Kudos
NachiChidambaram
Occasional Contributor

How do I find the associated portalItem id ?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nachi,

  It is right in the url you have in your first post:

b74e3eeef31942869c1f611f341ce8ed

0 Kudos