Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <link rel="icon" type="image/png" href="https://www.prettymap.gr/japan-3d-anaglyph-map/3d-glasses.svg" />

<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet">

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

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

<div id="mapTitle">
<h1>Japan 3D Anaglyph Map</h1>
<h2>
<a href="https://github.com/tjukanovt/30DayMapChallenge#30daymapchallenge-" alt="30 Day Map Challenge" target="_blank" rel="nofollow">#30DayMapChallenge</a> | November 2020 | Day26: Map with a New Tool
</h2>
</div>

<div id="logo">
<a href="https://www.staridasgeography.gr/" alt="Staridas Geography" target="_blank">
<img src="https://www.prettymap.gr/japan-3d-anaglyph-map/staridas-geography-logo.svg" />
</a>
</div>

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

CSS

              
                #viewDiv {
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  padding:0;
  margin:0;
  border:0;
}
  
*:focus {
  outline: 0!important;
}

a, a:visited, a:active, a:focus {
  text-decoration: none;
  color: inherit;
}

a:hover {
  color: #444444;
}

#viewDiv {
  cursor: grab;
}

#mapTitle {
  margin:0 0.5em 0 0;
  box-shadow:none; 
  font-family: 'Raleway', sans-serif;
  text-align: right;

}

h1 {
  font-size:2em;
}

h2 {
  font-size:0.8em;
}

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

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

/* MOBILE */
@media only screen and (max-width: 767px) {
  #mapTitle {
    width:50%;
  }

  #mapTitle h1 {
    line-height: 1.15em;
    font-size: 1.7em;
    margin-bottom: 0;
  }

  #logo img {
    width: 4em;
  }

}
              
            
!

JS

              
                /* Blend Modes */
var b1 = 'average';
var b2 = 'color-burn';
var b3 = 'color-dodge';
var b4 = 'color';
var b5 = 'darken';
var b6 = 'destination-atop';
var b7 = 'destination-in';
var b8 = 'destination-out';
var b9 = 'destination-over';
var b10 = 'difference';
var b11 = 'exclusion';
var b12 = 'hard-light';
var b13 = 'hue';
var b14 = 'invert';
var b15 = 'lighten';
var b16 = 'lighter';
var b17 = 'luminosity';
var b18 = 'minus';
var b19 = 'multiply';
var b20 = 'normal';
var b21 = 'overlay';
var b22 = 'plus';
var b23 = 'reflect';
var b24 = 'saturation';
var b25 = 'screen';
var b26 = 'soft-light';
var b27 = 'source-atop';
var b28 = 'source-in';
var b29 = 'source-out';
var b30 = 'vivid-light';
var b31 = 'xor';

var lat = 35.383223;
var lng = 139.3288247;

require(
    [
        'esri/Map',
        'esri/views/MapView',
        'esri/widgets/Home',
        'esri/widgets/Fullscreen',
        'esri/layers/TileLayer',
        'esri/layers/WebTileLayer',
        'esri/layers/VectorTileLayer'

    ],  
        function (
            Map,
            MapView,
            Home,
            Fullscreen,
            TileLayer,
            WebTileLayer,
            VectorTileLayer
            ) 
            {

        const imagery = new TileLayer({
            url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
            blendMode: b2,
            opacity: 0.8,
            copyright: 
                    '<a href="https://staridasgeo.maps.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9" target="_blank" rel="nofollow">' + 
                        'World Imagery' + 
                    '</a>'
            });

        const transportation = new TileLayer({
            url: 'https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer',
            blendMode: b17,
            opacity: 0.6,
            copyright: 
                    '<a href="https://staridasgeo.maps.arcgis.com/home/item.html?id=94f838a535334cf1aa061846514b77c7" target="_blank" rel="nofollow">' + 
                        'World Transportation' + 
                    '</a>'
            });

        const anaglyph = new WebTileLayer({
            urlTemplate: 'https://maps.gsi.go.jp/xyz/anaglyphmap_gray/{level}/{col}/{row}.png',
            blendMode: b19,
            opacity:1.0,
            copyright:
                    '<a href="https://staridasgeo.maps.arcgis.com/home/item.html?id=5003e6487cf44d388606284e20c655f9" target="_blank" rel="nofollow">' + 
                        'Anaglyph Gray' + 
                    '</a>'
            });

        const labels = new TileLayer({
            url: 'https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer',
            blendMode: b20,
            opacity:1.0,
            copyright:
                    '<a href="https://staridasgeo.maps.arcgis.com/home/item.html?id=87fcdf91a0f14e4a9fda40a763c6f2b8" target="_blank" rel="nofollow">' + 
                        'World Light Gray Reference' + 
                    '</a>'
            });

        const contours = new VectorTileLayer({
            url: 'https://basemaps.arcgis.com/arcgis/rest/services/World_Contours_v2/VectorTileServer',
            blendMode: b20,
            opacity:1.0,
            copyright:
                    '<a href="https://www.arcgis.com/home/item.html?id=51ca3ce6a16d4080ad955dacd6dd2fe2" target="_blank" rel="nofollow">' + 
                        'World Contours' + 
                    '</a>'
            });

        const map = new Map({
          //basemap: 'satellite',
            layers: [
                imagery,
                contours,
                transportation,
                anaglyph,
                labels
                ]
            });

        const view = new MapView({
            container: 'viewDiv',
            map: map,
            scale: 550000,
            center: [lng,lat],
            background: {
                color: '#f9f9f9'
              }
            });

        const homeBtn = new Home({
            view: view
            });
 
        fullscreen = new Fullscreen({
            view: view
            });

        view.ui.add(homeBtn, 'top-left');
        view.ui.add(fullscreen, 'top-left');
        view.ui.add('mapTitle', 'top-right');
        view.ui.add('logo', 'bottom-right');
        
});

/* ---------------------------------------------------
Written by STARIDAS GEOGRAPHY Making Maps Pretty 
info@staridasgeography.gr | www.staridasgeography.gr
Copyright 2020 | All Rights Reserved | CC BY-NC-SA 4.0
---------------------------------------------------- */
              
            
!
999px

Console