Coder Social home page Coder Social logo

qberto / story-map-journal-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from glazou/story-map-journal-generator

0.0 2.0 0.0 240 KB

Generate your Story Map Journal programmatically

License: Apache License 2.0

CSS 1.97% JavaScript 88.25% HTML 9.78%

story-map-journal-generator's Introduction

Story Map Journal Generator

Story Map Journal is ideal when you want to combine narrative text with maps and other embedded content.

The typical Map Journal creation involve using the integrated WYSIWYG builder. This application let you generate a Map Journal through a simple JSON document, without using that builder.

The resulting application is hosted in ArcGIS Online, you can edit it later as if you had used the builder.

Live demo | Map Journal GitHub repository | Map Journal page on Esri Story Maps website

Instructions

The usage scenarios are:

  • as a node.js application with ArcGIS Online credentials defined in the configuration file
  • as a web application with authentication through ArcGIS Online OAuth dialog
  • as a web application with authentication through ArcGIS Online credentials defined provided in the configuration file

As a Node.js application

  1. Install Node.js
  2. Download the application
  3. Run npm install in the application root
  4. Edit app/app.js with your credentials
  5. Optionally, if you are going to use the webmap-x-y type, edit app/app.js with a webmap ID
  6. Run node index

As a web application with OAuth authentication

  1. Download the application
  2. Deploy on a web server
  3. Edit app/app.js with an ArcGIS Online OAuth App ID, see adding apps for ArcGIS Online for Organizations users or registering your application for ArcGIS for Developers users
  4. Optionally, if you are going to use the webmap-x-y type, edit app/app.js with a webmap ID
  5. Access the application over the web server

As a web application with ArcGIS Online credentials

  1. Install Node.js
  2. Download the application
  3. Run npm install in the application root
  4. Edit app/app.js with your credentials
  5. Optionally, if you are going to use the webmap-x-y type, edit app/app.js with a webmap ID
  6. Access the application over the web server

Make sure to not deploy the application on a public server to avoid exposing your credentials.

JSON configuration

The JSON defining the Map Journal to be generated can be edited through data/map-journal-sample.json.

The general JSON structure is:

{
	title: 'Journal title',
	sections: [
		{
			// First
		},
		{
			// Second section
		},
		// ... limited to 99 sections ... 
	]
}

With a section being defined by a title a Main Stage (larger area) and Panel (smaller scollable area intended for the narrative).

{
	"title": "",
	"mainstage": {
		// Image, video, webpage or map configure goes here
	},
	"panel": {
		// Text, can include images, videos, webpage and map 
	}
}

See some examples below.

Section with an image in the Main Stage

{
	"title": "<p>First section</p>",
	"mainstage": {
		"type": "image",
		"url": "http://farm8.static.flickr.com/7373/13429795365_f57595be16_b.jpg"
	},
	"panel": {
		"text": "<p>Image in main stage</p>"
	}
}

Section with a web map in the Main Stage

{
   "title": "<p>Second section</p>",
   "mainstage": {
   	"type": "webmap",
   	"id": "ea8e4e1f70014f3a8919dc3d8c08a29e"
   },
   "panel": {
   	"text": "<p>A Map of <strong>world volcanoes</strong>.</p><p>&nbsp;</p><p>&nbsp;</p><p>Open the Map in <a href=\"http://www.arcgis.com/home/webmap/viewer.html?webmap=2a45f767a6e549bfbe5bf638681f1fac\" target=\"_blank\">ArcGIS Online Map Viewer</a>.<p>&nbsp;</p><p>&nbsp;</p></p>"
   }
}

Section with a web page in the Main Stage and an image in the panel

{
   "title": "<p>Third section</p>",
   "mainstage": {
   	"type": "webpage",
   	"url": "http://story.maps.arcgis.com/home/webscene/viewer.html?webscene=fd3b56984801434aa71f75b1926bde5b&ui=min"
   },
   "panel": {
   	"text": "<p>Embed of ArcGIS Online scene viewer, <a href=\"http://story.maps.arcgis.com/home/webscene/viewer.html?webscene=fd3b56984801434aa71f75b1926bde5b\" target=\"_blank\">link to the scene</a>.</p><p><div class=\"image-container activate-fullscreen\"><img src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Fimmvorduhals_2010_03_27_dawn.jpg/1280px-Fimmvorduhals_2010_03_27_dawn.jpg\" /></div></p>"
   }
}

Section with a map in the Main Stage and in the panel configured as an x/y

{
   "title": "<p>Fourth <strong style=\"color:red\">section</strong></p>",
   "mainstage": {
   	"type": "map-x-y",
   	"x": -116.538019,
   	"y": 33.825898,
   	"mapScale": "block",
   	"mapSymbolUrl": "http://static.arcgis.com/images/Symbols/Shapes/PurplePin2LargeB.png",
   	"popupContents": "Hello Palm Springs!"
   },
   "panel": {
   	"text": "<p>Map in the main stage <strong>+ map in the panel</strong></p>",
   	"map": {
   		"x": -116.538019,
   		"y": 33.825898,
   		"mapScale": "continent"
   	}
   }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.