I declare a MapImageLayer using the following. It is a service hosted locally.
var baseMapLayer = new MapImageLayer({
url: "https://esridev.nsamedia.com/arcgis/rest/services/States/MapServer"
});
I apply it to a new BaseMap.
var basemapDefault = new Basemap({
baseLayers: [baseMapLayer],
title: "Custom Basemap",
id: "myBasemap"
});
I apply the basemapDefault to a Map object and then use that Map object in my MapView
var map = new Map({
basemap: basemapDefault,
layers: [highlightGeographyLyr, colorOverlayLyr, hatchOverlayLyr, locationOverlayLyr, competitorOverlayLyr]
});
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 20,
center: [-119.41793, 36.7783]
});
Everything works correctly except for my zoom and center property. No matter what I put in the zoom or center, the map initially loads that same way.
What I am doing wrong?
Solved! Go to Solution.
David,
If your basemap is not tiled then the zoom property has no bearing in your situation.
Robert, thank you again.
My basemap is not tiled. So is there any way to set the my map so when initially loaded it will be at a specific area at a specific scale? I am having a user setup their map the way they want it, so when they come back into it, the map looks the same.
David,
Sure you just use the scale property instead of zoom.
Thank you.