I'm labeling a feature layer, and the labels were showing up underneath the light gray basemap reference layer. I tried switching my basemap from gray to gray-vector and everything disappeared. I have esriBasemaps in my requires and function sections.
map = new Map("map", {
basemap: "gray-vector",
center: [0, 45],
zoom: 2,
maxZoom: 10,
minZoom: 2,
infoWindow: popup,
showLabels: true
});
Ran a quick test and this code works for me.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Simple Map</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">
<style>
html, body, #map {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://js.arcgis.com/3.20/"></script>
<script>
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("map", {
basemap: "gray-vector", //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd
center: [0,45], // longitude, latitude
zoom:2,
maxZoom:10,
minZoom:2,
showLabels:true
});
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
Strange. It doesn't work in Chrome on the Windows 10 server machine I'm working on, but it works on Chrome on my Mac.
Any error messages in the Chrome dev tools?
I get this error in the console. js.arcgis.com/3.20/init.js:594 Uncaught TypeError: Cannot read property '_surface' of undefined
It also shows up at zoom 3, even though the zoom is set to 2. Bugs?
I tested on my Windows machine and can't reproduce although its Windows 8.1. Which version of Chrome are you using? Is it up to date?
Just updated Chrome on Windows 10 to Version 58.0.3029.81. Still not working. It works on Chrome for Windows 7 and Mac OS El Capitan.
We tested on two Windows 10 machines with Chrome 57 and Chrome 58 and couldn't reproduce. You may want to submit a support ticket to see if they can help you troubleshoot the issue.
OK, Thanks.