Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta name="description" content="Feature Layer w/ min/max scale hack" />
  <title>Create a Map</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
  <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
  <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
  <style>
    html, body, #mapDiv {
      padding: 0;
      margin: 0;
      height: 100%;
    }
  </style>
  
  <script src="http://js.arcgis.com/3.8/"></script>
  <script>
    require(["esri/map",
             "esri/layers/FeatureLayer",
             "dojo/domReady!"], 
             
      function(Map, FeatureLayer) { 
         map = new Map("mapDiv", {
            center: [-111.8, 40.7],
            zoom: 3,
            basemap: "gray"
          });
      
        //this layer has minscale of 100,000 yet it will be drawn on this map at zoom level 3
        l = new FeatureLayer('http://sampleserver6.arcgisonline.com/arcgis/rest/services/RedlandsEmergencyVehicles/FeatureServer/0');
        l.on("load", function() { l.minScale = 0; l.maxScale = 0; });
        map.addLayer(l);
    });
  </script>
</head>
<body class="claro">
  <div id="mapDiv"></div>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
dbouwmanpro
0viewers