Creating a custom reference basemap in 3.15

2404
4
Jump to solution
01-20-2016 11:57 AM
DavidChrest
Occasional Contributor II

I am confused by the esri/basemaps documentation here: esri/basemaps | API Reference | ArcGIS API for JavaScript.

Is one able to add say a webTileLayer or VectorTileLayer as a custom basemap in the Map constructor (if so, how exactly does the syntax work?), or is this just meant for simply referencing a simple URL as the example shows for the Delorme basemap service?

0 Kudos
1 Solution

Accepted Solutions
MichaelVolz
Esteemed Contributor

I think I asked this same type of question to ESRI about 1 year ago and the ESRI rep. said that the basemap syntax was strictly for ESRI basemaps, so you would need to use the same syntax that Chris and yourself have used in the past for your own custom basemaps.

View solution in original post

0 Kudos
4 Replies
ChrisSmith7
Frequent Contributor

I've always added custom basemaps after map initialization, like so:

var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("service URL goes here");
map.addLayer(baseMapLayer);
0 Kudos
DavidChrest
Occasional Contributor II

Yes, I've done the same, but what I'm wondering is if it is possible to add a custom reference default basemap layer straight into the "basemap" property of the Map constructor as is shown here: esri/basemaps | API Reference | ArcGIS API for JavaScript.

The problem is the example just has one supply a simple URL with no other parameters. But how would one add ad webTiledLayer or a VectorTileLayer as the custom reference default basemap  in the Map constructor? Is it posible?

This is in an effort to understand the last listed known Issues for a VectorTileLayer here: VectorTileLayer | API Reference | ArcGIS API for JavaScript

I think it's saying we need a VectorTileLayer as our default reference basemap in order to have it appear in our printout when printing.

0 Kudos
MichaelVolz
Esteemed Contributor

I think I asked this same type of question to ESRI about 1 year ago and the ESRI rep. said that the basemap syntax was strictly for ESRI basemaps, so you would need to use the same syntax that Chris and yourself have used in the past for your own custom basemaps.

0 Kudos
DavidChrest
Occasional Contributor II

OK, thanks Michael for confirming. After much trial and error today, this is pretty much what I figured. Especially since the URL used in the sample is "http://services.arcgisonline.com/ArcGIS/rest/services..." I remember this coming out in 3.12 to give users at leas other options besides the standard default reference basemaps listed for the basemap property  for the Map Constructor in the API documentation.

Much thanks.

0 Kudos