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

              
                <!---------------------------------------------------
Written by STARIDAS GEOGRAPHY #MakingMapsPretty 
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2021 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------->

<link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/dark/main.css" />

<style>
  .esri-scale-bar__line {
    background:transparent;
  }
  .esri-scale-bar__line--top {
    bottom:2px;
    border-bottom:1.5px solid #000;
  }
  .esri-scale-bar__line--top:before, 
  .esri-scale-bar__line--top:after {
    bottom:0;
    width:1px;
    height:1.5em;
    border-right:1.5px solid #000;
  }
  .esri-scale-bar__line--bottom {
    top: 1px;
    border-top:1.5px solid #000;
  }
  .esri-scale-bar__line--bottom:before, 
  .esri-scale-bar__line--bottom:after {
    top:0;
    width:1px;
    height:1.2em;
    border-right:1.5px solid #000;
  }
  .esri-scale-bar__label {
    font-family: 'Josefin Slab', serif;
    font-style: italic;    
    font-size:1.3em;
    color:#000;
    margin:0.16em;
  }
  .esri-attribution {
    background:transparent;
    font-family: 'Josefin Sans', sans-serif;
    font-weight:600;
    font-size:0.9em;
    color:#000;
    border:0;
  }
</style>

<div id="viewDiv"></div>

<div id="mapTitle">
  <h1>Nuova Pianta Topografica</h1>
</div>

<div id="zoomLevel"></div>

<div id="logo">
  <a href="https://www.staridasgeography.gr/" alt="Staridas Geography" target="_blank">
    <img src="https://www.prettymap.gr/nuova-pianta-topografica/staridas-geography-logo.svg" />
  </a>
</div>

<script src="https://js.arcgis.com/4.18/"></script>

<!---------------------------------------------------
Written by STARIDAS GEOGRAPHY #MakingMapsPretty  
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2021 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------->
              
            
!

CSS

              
                /* ---------------------------------------------------
Written by STARIDAS GEOGRAPHY #MakingMapsPretty  
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2021 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Josefin+Slab:ital,wght@1,700&display=swap');

* {
  font-family: 'Josefin Sans', sans-serif;
  font-size:1em;
}

#viewDiv {
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  padding:0;
  margin:0;
  border:0;
}

#mapTitle {
  margin:0;
  box-shadow:none;
  pointer-events:none!important;
}

#mapTitle h1 {
  font-family: 'Josefin Slab', serif;
  font-style: italic;
  font-size:2rem;
  pointer-events:none!important;
}

#zoomLevel {
  box-shadow:none;
  font-family: 'Josefin Slab', serif;
  font-style: italic;
  font-size:1.4rem;
  pointer-events:none!important;
  padding:0.3em;
}

#logo {
  margin:0;
  box-shadow:none;
}

#logo img {
  width: 5em;
  filter: saturate(0) brightness(0);
}


/* MOBILE */
@media only screen and (max-width: 767px) {

  #mapTitle {
    max-width:70%;
  }

  #logo img {
    width: 4em;
  }

}

/* ---------------------------------------------------
Written by STARIDAS GEOGRAPHY #MakingMapsPretty  
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2021 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------- */
              
            
!

JS

              
                /* ---------------------------------------------------
Written by STARIDAS GEOGRAPHY #MakingMapsPretty  
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2021 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------- */

require([
  'esri/Map',
  'esri/views/MapView',
  'esri/widgets/Home',
  'esri/widgets/Zoom',
  'esri/widgets/ScaleBar',
  'esri/widgets/Expand',
  'esri/widgets/Search',
  'esri/layers/VectorTileLayer'
],
        function(
        Map,
         MapView,
         Home,
         Zoom,
         ScaleBar,
         Expand,
         Search,
         VectorTileLayer
        ) {

  /* Nuova Pianta Topografica Esri Vector Basemap 
  https://www.staridasgeography.gr/how-to-make-a-vintage-city-style-for-esri-vector-basemaps-part-1/
  https://staridasgeo.maps.arcgis.com/home/item.html?id=5966e5c11e2443e1b927e0209547582f
  */
  var item = '5966e5c11e2443e1b927e0209547582f';
  const NuovaPiantaTopografica = new VectorTileLayer({
    url:'https://staridasgeo.maps.arcgis.com/sharing/rest/content/items/' + item + '/resources/styles/root.json',
    blendMode: 'normal',
    opacity: 1.0,
  });
  
  /* 
Texture Tiles by John Nelson
https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/mapping/texture-tiles/
https://nation.maps.arcgis.com/home/group.html?id=94f25306e1d142beacd87b005f6cc1d0&focus=layers&view=list#content
  */

  /* Crinkled Paper Texture */
  const CrinkledPaperTexture = new VectorTileLayer({
    url:'https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/CrinkledPaperTexture/VectorTileServer',
    blendMode: 'multiply',
    opacity: 1.0,
  });

  /* Folded Paper Texture */
  const FoldedPaperTexture = new VectorTileLayer({
    url:'https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/FoldedPaperTexture/VectorTileServer',
    blendMode: 'multiply',
    opacity: 1.0,
  });

  /* Poster Paper Texture */
  const PosterTexture = new VectorTileLayer({
    url:'https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/PosterTexture/VectorTileServer',
    blendMode: 'multiply',
    opacity: 1.0,
  });

  /* Watercolor Paper Texture */ 
  const Watercolor_paper_texture = new VectorTileLayer({
    url:'https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/Watercolor_paper_texture/VectorTileServer',
    blendMode: 'multiply',
    opacity: 1.0,
  });

  /* Parchment Texture */
  const ParchmentTexture = new VectorTileLayer({
    url:'https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/ParchmentTexture/VectorTileServer',
    blendMode: 'multiply',
    opacity: 1.0,
  });

  /* Map */
  const map = new Map({
    layers: [
      NuovaPiantaTopografica,
      //CrinkledPaperTexture,
      //PosterTexture
      FoldedPaperTexture,
      Watercolor_paper_texture,
      //ParchmentTexture
    ]
  });

  /* Map View */
  const view = new MapView({
    container: 'viewDiv',
    map: map,
    center: [-18.357156,64.9334279],
    zoom: 6,
    ui: {
      components: ['attribution']
    }
  });

  /* Title */
  view.ui.add(
    'mapTitle', {
      position: 'top-left',
      index: 0
    }
  );

  /* Home */
  view.ui.add(
    new Home({
      view: view
    }), {
      position: 'top-right',
      index: 1
    }
  );

  /* Zoom */
  view.ui.add(
    new Zoom({
      view: view
    }), {
      position: 'top-right',
      index: 2
    }
  );

  /* Search */
  view.ui.add(
    new Expand({
      view: view,
      content: new Search({
        view: view,
        container: document.createElement('div')
      })
    }), {
      position: 'top-right',
      index: 3
    }
  );

  /* ScaleBar */
  view.ui.add(
    new ScaleBar({
      view: view,
      unit: 'dual'
    }), {
      position: 'bottom-left',
      index: 0
    }
  );

  /* zoomLevel */
  view.ui.add(
    'zoomLevel', {
      position: 'bottom-left',
      index: 0
    }
  );  

  document.getElementById('zoomLevel').innerHTML = view.get('zoom').toFixed(0);

  view.watch('zoom', function() {
    document.getElementById('zoomLevel').innerHTML = view.get('zoom').toFixed(0);
  });


  /* Logo */
  view.ui.add(
    'logo', {
      position: 'bottom-right',
      index: 0
    }
  );

});

/* ---------------------------------------------------
Written by STARIDAS GEOGRAPHY #MakingMapsPretty  
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2021 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------- */
              
            
!
999px

Console