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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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" />
  ArcGIS API for JavaScript,
  For more information about the layers-geojson sample, read the original sample description at

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

    <script src=""></script>

      ], function(Map, GeoJSONLayer, MapView) {
        // If GeoJSON files are not on the same domain as your website, a CORS enabled server
        // or a proxy is required.
        const url =

        // Paste the url into a browser's address bar to download and view the attributes
        // in the GeoJSON file. These attributes include:
        // * mag - magnitude
        // * type - earthquake or other event such as nuclear test
        // * place - location of the event
        // * time - the time of the event
        // Use out of box popupTemplate function DateString to format time field into a human-readable format

        const template = {
          title: "Info sur la ligne",
          content: "Code: {CODE}<br/>Libellé: {LIBELLE}"

        const renderer = {
          type: "simple",
          field: "CODE",
          symbol: {
            type: "simple-line",
            color: "blue",
            outline: {
              color: "white"

        const geojsonLayer = new GeoJSONLayer({
          url: url,
          copyright: "Métropole de Grenoble - Open Data",
         popupTemplate: template,
         renderer: renderer //optional

        const map = new Map({
          basemap: "gray",
          layers: [geojsonLayer]

        const view = new MapView({
          container: "viewDiv",
          center: [5.7, 45.1],
          zoom: 10,
          map: map

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