Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ add another resource


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


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.


Save Automatically?

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.



  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <link rel="stylesheet" href="">

    #Panel {
      padding: 30px;
      background-color: rgba(255, 255, 255, 0.8);

    .esri-button {
      margin: 2px;

    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;

  <!-- <link rel="stylesheet" href=""> -->
  <script src=""></script>

    ], function (Map, MapView, FeatureLayer,Expand,dom, on,Query,GraphicsLayer,Feature,StatisticDefinition) {
      var pointService = new FeatureLayer({
        url: "",
      var newRend, layer;
      var map = new Map({
        basemap: "gray",
        layers: [pointService]

      var view = new MapView({
        container: "viewDiv",
        map: map,
        center: [-102.370576, 40.172530],
        zoom: 5
//popup view///////////////////////////////////////////////////////////////////////

     const graphic = {
            popupTemplate: {
              content: "Enter a feature to show details..."
     const feature = new Feature({
            graphic: graphic,
            view: view

          view.ui.add(feature, "bottom-left");      
    var origRend = {
          type: "simple",
          symbol: {
            type: "simple-marker",
            style: "circle",
            color: [0, 197, 255, 255],
            size: 7,
            outline: {
              color: [255, 255, 255, 255],
              width: 0.75

      ///create a new layer from the query, replace the old one. zoom into it and edit the popup/////////////////////////////////////////
      function succ(featureSet) {
     var stats = featureSet.features[0].attributes; //////stats for display in feature/popupTemplate
        /////////// creaye new layer
        layer = new FeatureLayer({
          objectIdField: "OBJECTID", 
          source: featureSet.features,
          fields: featureSet.fields,
          popupTemplate: {
           content: "price to meter in {name1} is {OBJECTID}" ///add stats to here!!!!!
          renderer: newRend
        ////////////// replace old layer
        ///////////// zoom into new layer
        layer.when(function() {
          feature.graphic = featureSet.features[0];
          console.log("layer.fields", layer.fields)
          return layer.queryExtent();
        .then(function(response) {
      function fail(error) {
        console.error('An error ocurred in the query: ', error);

      on(dom.byId('input'), 'change', function (e) {
        var input =;
        var gushHelka;                 
        if (input) {
          gushHelka = "OBJECTID"
          newRend = origRend
        else {
        gushHelka = "1",
        input = "1"
        newRend = origRend          
          var avgPricePerMeter = {
            onStatisticField: "OBJECTID",  // service field for 2015 population
            outStatisticFieldName: "PricePerMeter_avg",
            statisticType: "avg"
          var query = pointService.createQuery();     
          query.returnGeometry = true;
          query.outFields = ["*"];
          query.where = gushHelka + " = " + input// input;
//          query.outStatistics = [avgPricePerMeter]
          pointService.queryFeatures(query).then(succ, fail);                              
      view.ui.add("Panel", "top-right");

  <div id="viewDiv"></div>
  <div id="Panel" class="esri-widget">
          <h2>גוש חלקה</h2>
    <input type="text" placeholder="חפש לפי גוש-חלקה" id="input" class="esri-input" >