Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>Map Lagging on Drag and Drop</title>
  <style>
    html, body, #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
  </style>
  
    <link rel="stylesheet" href="https://js.arcgis.com/4.17/esri/themes/light/main.css">
  <script src="https://js.arcgis.com/4.17/"></script>
  
  <script>  
    require([
      "esri/Map",
      "esri/views/MapView",
      "esri/Graphic",
      "esri/layers/GraphicsLayer"
    ], function(Map, MapView, Graphic, GraphicsLayer) {

const GasLayer = new GraphicsLayer();
      const GASsymbol = {
         type: "simple-marker",
         color: [226, 119, 40],  
         outline: {
           color: [255, 255, 255],
           width: 1
         }
       };
var firstGPoint = {lng: 35.68179322626343, lat: 32.7032607134338};//
var secondGPoint ={lng: 37.55106609791145, lat: 29.523433477484673};//, 
 var lngSpan = secondGPoint.lng - firstGPoint.lng;
 var latSpan = secondGPoint.lat - firstGPoint.lat;

       for (var i = 0; i < 200; i++) {
         
//lat: southWest.lat + latSpan * Math.random()
//lng: southWest.lng + lngSpan * Math.random()

var Gpoint = ({
      type: 'point', 
      longitude: secondGPoint.lng + lngSpan * Math.random(),
      latitude: firstGPoint.lat + latSpan * Math.random()
    });
      
      // console.log(MPpoint);
let GGraphic= new Graphic({
            geometry: Gpoint,
            symbol: GASsymbol
          });
         

  GasLayer.add(GGraphic);
       }
     
// -----------------------------------------      

      
const AssemblyPointsLayer = new GraphicsLayer();
   const Assemblysymbol = {
         type: "simple-marker",
         color: [216, 219, 140],  
         outline: {
           color: [255, 255, 255],
           width: 1
         }
       };
var firstAPPoint = {lng: 37.226881135151984, lat: 32.01130607862244};//, , 
var secondAPPoint ={lng: 35.623936448476556, lat: 31.75925603138367};//, 
 var lngSpan = secondAPPoint.lng - firstAPPoint.lng;
 var latSpan = secondAPPoint.lat - firstAPPoint.lat;

       for (var i = 0; i < 200; i++) {
         
//lat: southWest.lat + latSpan * Math.random()
//lng: southWest.lng + lngSpan * Math.random()

var APpoint = ({
      type: 'point', 
      longitude: secondAPPoint.lng + lngSpan * Math.random(),
      latitude: firstAPPoint.lat + latSpan * Math.random()
    });
      
      // console.log(MPpoint);
let APGraphic= new Graphic({
            geometry: APpoint,
            symbol: Assemblysymbol
          });
         

  AssemblyPointsLayer.add(APGraphic);
       }
    

      
//--------------------------------

const RoadElementsLayer = new GraphicsLayer();
const RoadElementsymbol = {
         type: "simple-marker",
         color: [210, 19, 100],  
         outline: {
           color: [255, 255, 255],
           width: 1
         }
       };

var firstREPoint = {lng: 35.74267309033108, lat: 32.324798989215346};//, 
var secondREPoint ={lng: 35.623936448476556, lat: 31.75925603138367};//, 
 var lngSpan = secondREPoint.lng - firstREPoint.lng;
 var latSpan = secondREPoint.lat - firstREPoint.lat;

       for (var i = 0; i < 100; i++) {
         
//lat: southWest.lat + latSpan * Math.random()
//lng: southWest.lng + lngSpan * Math.random()

var REpoint = ({
      type: 'point', 
      longitude: secondREPoint.lng + lngSpan * Math.random(),
      latitude: firstREPoint.lat + latSpan * Math.random()
    });
      
      // console.log(MPpoint);
let REGraphic= new Graphic({
            geometry: REpoint,
            symbol: RoadElementsymbol
          });
         

  RoadElementsLayer.add(REGraphic);
       }
    

      
  //---------------------------------    
      
      
      
  
const AbnormalLayer = new GraphicsLayer();
    const AbnormalSymbol = {
         type: "simple-marker",
         color: [90, 50, 190],  
         outline: {
           color: [255, 255, 255],
           width: 1
         }
       };

var firstAbnormalPoint = {lng: 35.74267309033108, lat: 32.324798989215346};//, 
var secondAbnormalPoint ={lng: 36.26850678997251, lat: 31.9009690624039};//, 
 var lngSpan = secondAbnormalPoint.lng - firstAbnormalPoint.lng;
 var latSpan = secondAbnormalPoint.lat - firstAbnormalPoint.lat;

       for (var i = 0; i < 500; i++) {
         
//lat: southWest.lat + latSpan * Math.random()
//lng: southWest.lng + lngSpan * Math.random()

var ANpoint = ({
      type: 'point', 
      longitude: secondAbnormalPoint.lng + lngSpan * Math.random(),
      latitude: firstAbnormalPoint.lat + latSpan * Math.random()
    });
      
      // console.log(MPpoint);
let ANGraphic= new Graphic({
            geometry: ANpoint,
            symbol: AbnormalSymbol
          });
         

  AbnormalLayer.add(ANGraphic);
       }

      
//------------------------------
const FollowupLayer = new GraphicsLayer();
const Followupsymbol = {
         type: "simple-marker",
         color: [22, 209, 70],  
         outline: {
           color: [255, 255, 255],
           width: 1
         }
       };

var firstPoint = {lng: 35.802161555281174, lat: 32.04295692985183};//, 
var secondPoint ={lng: 35.91104651191155, lat: 32.002227319299166};//, 
 var lngSpan = secondPoint.lng - firstPoint.lng;
 var latSpan = secondPoint.lat - firstPoint.lat;

       for (var i = 0; i < 250; i++) {
         
//lat: southWest.lat + latSpan * Math.random()
//lng: southWest.lng + lngSpan * Math.random()

var FUpoint = ({
      type: 'point', 
          longitude: secondPoint.lng + lngSpan * Math.random(),
          latitude: firstPoint.lat + latSpan * Math.random()
    });
      
      // console.log(FUpoint);
let FUGraphic= new Graphic({
            geometry: FUpoint,
            symbol: Followupsymbol
          });
         

  FollowupLayer.add(FUGraphic);
       }



  //-----------------------------------    
const ZonesLayer = new GraphicsLayer();
 const polygonSymbol1 = {
      type: 'simple-fill',
      color: [227, 139, 79, 0.8],
      outline: {
        color: [255, 255, 255],
        width: 1
      },

    };
 const polygonSymbol2 = {
      type: 'simple-fill',
      color: [200, 215, 55, 0.8],
      outline: {
        color: [255, 255, 255],
        width: 1
      },

    };

 const polygonSymbol3 = {
      type: 'simple-fill',
      color: [30, 88, 194, 0.8],
      outline: {
        color: [255, 255, 255],
        width: 1
      },

    };

const polygon1 = {
      type: 'polygon',
      rings: [
        [35.923278195822114, 31.99999891257621],
        [36.0429345674631, 31.984637577913922],
        [35.987441757426694, 31.90942800637867],
        [35.81942186037204,31.97336006740776]
      ],
    };

const polygon2 = {
      type: 'polygon',
      rings: [
        [35.88551225565845, 31.920059180202443],
        [35.79225350545838, 31.939682734537588],
        [35.811521842276576, 31.998691665109767],
        [35.987441757426694, 31.90942800637867]
        
      ],
    };

const polygon3 = {
      type: 'polygon',
      rings: [
        [35.844470698235696, 32.01388726584462],
        [35.88782445607663, 32.03773764299203],
        [36.055458986394925, 32.003757145226864],
        [36.06759803859039, 31.971725530615956],
        [35.96258560293123, 31.974994575092474]
      ],
    };

        let polygonGraphic1 = new Graphic({
          geometry: polygon1,
          symbol: polygonSymbol1
        });
        let polygonGraphic2 = new Graphic({
          geometry: polygon2,
          symbol: polygonSymbol2
        });
       let polygonGraphic3 = new Graphic({
          geometry: polygon3,
          symbol: polygonSymbol3
        });
      
      
        ZonesLayer.add(polygonGraphic1);
        ZonesLayer.add(polygonGraphic2);
        ZonesLayer.add(polygonGraphic3);


//------------------------
const MultiPointLayer = new GraphicsLayer();
      const MultiPointsymbol = {
         type: "simple-marker",
         color: [0, 0, 0],  
         outline: {
           color: [255, 255, 255],
           width: 1
         }
       };

var firstPoint = {lng: 35.90898500670856, lat: 32.025216087542155};
var secondPoint ={lng: 35.82459706641779, lat: 31.90663611423187};
 var lngSpan = secondPoint.lng - firstPoint.lng;
 var latSpan = secondPoint.lat - firstPoint.lat;

       for (var i = 0; i < 50; i++) {
         
//lat: southWest.lat + latSpan * Math.random()
//lng: southWest.lng + lngSpan * Math.random()

var MPpoint = ({
      type: 'point', 
      longitude: secondPoint.lng + lngSpan * Math.random(),
      latitude: firstPoint.lat + latSpan * Math.random()
    });
      
      // console.log(MPpoint);
let MPGraphic= new Graphic({
            geometry: MPpoint,
            symbol: MultiPointsymbol
          });
         

  MultiPointLayer.add(MPGraphic);
       }




//------------------------
      var map = new Map({
        basemap: "satellite",
          layers: [
            RoadElementsLayer,
            GasLayer,
            AssemblyPointsLayer,
            AbnormalLayer,
            ZonesLayer,
            FollowupLayer,
            MultiPointLayer
          ] 
      });

      var view = new MapView({
        container: "viewDiv",
        map: map,
        center:[35.84446064522718, 32.02168268133321],
      zoom: 10
      });

    });
  </script>
</head>
<body>
  <div id="viewDiv"></div>
</body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console