Hello Everyone, is it possible to add a featureclass mapservice as a base map in esri basemap gallery with existing basemaps in arcgis js api and also can I see the pop-up information of layer onclick event?
Thanks
Hi, thanks i can see ur map now, can you please test my mapservice here i have included?
Muqit,
Your layer is in a different spatial reference then the standard esri basemaps so it will not work with them.
Hello Robet, can I change spatial ref on the fly?
Regards
No all your basemaps have the be the same spatial reference to begin with.
To piggy back on this, is it possible to add an onclick event to a basemap toggle? such as to remove another layer in the map as well as the basemap change?
Brandon,
Sure just add your logic to the selection-change event handler:
basemapGallery.on("selection-change", function(evt) {
if(evt.target._selectedBasemap.title === "Community Addresses"){
var lyr = map.getLayer(map.layerIds[0]);
if(lyr && !lyr.infoTemplates){
lyr.setInfoTemplates({
0: { infoTemplate: _addressInfoTemplate }
});
}
}
var pane = registry.byId("bmTitlePane");
if (pane.open) {
pane.toggle();
}
});
Thanks Robert. This was very helpful. I am still trying to work this out.