Select to view content in your preferred language

Zoom in beyond the basemap's maximum zoom level in Javascript

10839
12
07-21-2013 11:04 PM
CrisBarredo
Emerging Contributor
Can someone help me on how to zoom in beyond the basemap's maximum zoom level in Javascript?
I'm using satellite as my basemap and I want to zoom in more than the maximum zoom level.
I'm also using ArcGIS Online to publish feature services created using ArcGIS Desktop.
0 Kudos
12 Replies
JeffPace
MVP Alum
oh ok i see the difference.

Yes I would actually like to display
0 Kudos
TracySchloss
Honored Contributor
Personally I would like to at least see all the basemaps match to have the same thresholds.  For whatever reason, the gray canvas background ends at 16, which is much farther out than the others!
0 Kudos
JordanBaumgardner
Frequent Contributor

Just to save someone some linking in the future. I pulled the relevant code:

require([
"esri/Map",
"esri/views/MapView",
"esri/layers/support/LOD",
"dojo/domReady!"
], function (Map, MapView, LOD) {

var lods = [];
var tilesize = 256;
var earthCircumference = 40075016.685568;
var halfEarthCircumference = halfEarthCircumference * 0.5;
var inchesPerMeter = 39.37;
var initialResolution = earthCircumference / tilesize;
for (var zoom = 0; zoom <= 27; zoom++) {
var resolution = initialResolution / Math.pow(2, zoom);
var scale = resolution * 96 * inchesPerMeter;
lods.push(new LOD({
level: zoom,
scale: scale,
resolution: resolution
}));
}

var map = new Map({
basemap: "streets"
});

var view = new MapView({
container: "viewDiv",
map: map,
zoom: 18,
center: [-104.991531, 39.742043],
constraints: {
lods: lods
}
});
});