Skip to content

Commit

Permalink
Map Tour 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory L'Azou committed Dec 13, 2013
1 parent a2e5b94 commit e25889b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 82 deletions.
2 changes: 1 addition & 1 deletion MapTour/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "StorytellingMapTour",
"version": "2.2.0",
"version": "2.2.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
Expand Down
78 changes: 4 additions & 74 deletions MapTour/src/app/storymaps/builder/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ define(["esri/arcgis/Portal",
function saveWebmap(nextFunction)
{
//
// TODO: should be replaced by improved WebMapHelper.saveWebmap
// TODO: should be replaced by the improved WebMapHelper.saveWebmap
//

// Look for modified or new points if the tour use an embedded layer
Expand All @@ -450,86 +450,14 @@ define(["esri/arcgis/Portal",
webmapEmbeddedLayerChange = true;
}

// Look for basemap change
var basemapChanged = false;

/*
// Doesn't detect change or adding a reference layer
var webmapItem = app.data.getWebMapItem();
if ( webmapItem && webmapItem.itemData
&& webmapItem.itemData.baseMap && webmapItem.itemData.baseMap.baseMapLayers
&& webmapItem.itemData.baseMap.baseMapLayers[0]
&& app.map.layerIds[0]
&& app.map.getLayer(app.map.layerIds[0]) )
basemapChanged = webmapItem.itemData.baseMap.baseMapLayers[0].url != app.map.getLayer(app.map.layerIds[0]).url;
*/

var webmapBMLayers = app.data.getWebMapItem().itemData.baseMap.baseMapLayers;
var newBMLayers = [];

$.each(app.map.layerIds, function(i, layerName){
var layer = app.map.getLayer(layerName);
if( layer._basemapGalleryLayerType ) {
newBMLayers.push({
id: layer.id,
type: layer._basemapGalleryLayerType,
url: layer.url
});
}
});

if ( newBMLayers.length != webmapBMLayers.length )
basemapChanged = true;
else {
$.each(newBMLayers, function(i, layer){
if ( layer.url != webmapBMLayers[i].url )
basemapChanged = true;
});
}

if( basemapChanged ){
var newBMJSON = {
/*
* That's very lame but when the basemap is changed, the expected title isn't present in the layer
* That property is set when the basemap is changed
* Should use that to detect that the BM has changed or ask the JS API ...
* If the webmap fail to save, next save may not save it has the basemap has already been persisted...
*/

title: app.basemapChangeTitle || "Basemap",
baseMapLayers: []
};

$.each(newBMLayers, function(i, layer){
var bmLayerJSON = {
id: layer.id,
opacity: 1,
visibility: true,
url: layer.url
};

if ( layer.type == "reference" )
bmLayerJSON.isReference = true;

if ( layer.id == "layer_osm" ) {
delete bmLayerJSON.url;
bmLayerJSON.type = "OpenStreetMap";
}

newBMJSON.baseMapLayers.push(bmLayerJSON);
});

app.data.getWebMapItem().itemData.baseMap = newBMJSON;
}

// If the extent or data has changed
// or it's a direct creation initial save
// or the basemap has changed
if( app.data.initialExtentHasBeenEdited
|| webmapEmbeddedLayerChange
|| app.isDirectCreationFirstSave
|| app.isGalleryCreation
|| basemapChanged
|| app.basemapChanged
) {
var portalUrl = getPortalURL(),
item = lang.clone(app.data.getWebMapItem().item),
Expand Down Expand Up @@ -589,6 +517,7 @@ define(["esri/arcgis/Portal",
if( app.data.sourceIsFS() ) {
FeatureServiceManager.saveFS(
function() {
app.basemapChanged = true;
nextFunction(response);
},
function(error) {
Expand All @@ -605,6 +534,7 @@ define(["esri/arcgis/Portal",
else if ( app.data.sourceIsFS() ) {
FeatureServiceManager.saveFS(
function() {
app.basemapChanged = true;
nextFunction({success: true});
},
function(error) {
Expand Down
27 changes: 26 additions & 1 deletion MapTour/src/app/storymaps/maptour/builder/BuilderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,32 @@ define(["storymaps/maptour/core/WebApplicationData",
// Very lame but the title isn't saved in the new map layer
basemapGallery.on("selection-change",function(){
var basemap = basemapGallery.getSelected();
app.basemapChangeTitle = basemap.title;
var newBasemapJSON = [];

$.each(basemap.layers, function(i, layer){
var bmLayerJSON = {
id: basemap.id + '_' + i,
opacity: 1,
visibility: true,
url: layer.url
};

if ( layer.type == "reference" )
bmLayerJSON.isReference = true;
else if ( layer.type == "OpenStreetMap" ) {
delete bmLayerJSON.url;
bmLayerJSON.type = "OpenStreetMap";
}

newBasemapJSON.push(bmLayerJSON);
});

app.data.getWebMapItem().itemData.baseMap = {
baseMapLayers: newBasemapJSON,
title: basemap.title
};

app.basemapChanged = true;
topic.publish("BUILDER_INCREMENT_COUNTER", 1);
$("#basemapChooser").find('.dijitTitlePaneTitle').click();
});
Expand Down
2 changes: 1 addition & 1 deletion MapTour/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</script>

<script type="text/javascript">
var version = '2.2';
var version = '2.2.1';
var isProduction = false;

function loadJS(url, isExternal)
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The Map Tour template is designed for presenting geographic information where th

[View it live](http://storymaps.esri.com/stories/maptour-palmsprings/) |
[Features](http://arcgis.com/apps/MapTour/preview.html) |
[User Download (source code not included)](https://github.com/Esri/map-tour-storytelling-template-js/raw/master/Storytelling-MapTour-2.2.zip) |
[User Download (source code not included)](https://github.com/Esri/map-tour-storytelling-template-js/raw/master/Storytelling-MapTour-2.2.1.zip) |
[Developer Download](https://github.com/Esri/map-tour-storytelling-template-js/archive/master.zip)

**Latest release is version 2.2**, if you want to be informed of new releases, we recommend you to watch these repository.
**Latest release is version 2.2.1**, if you want to be informed of new releases, we recommend you to watch these repository.


The template produces an attractive, easy-to-use web application that lets you present a small set of places on a map in a numbered sequence through which users can browse. The template is designed to be used in any web browser on any device, including smartphones and tablets.
Expand Down Expand Up @@ -81,7 +81,7 @@ Note that the interactive builder is available in the downloadable version but w

## How to deploy a Map Tour

To use the downloadable version, download the [User Download archive](https://github.com/Esri/map-tour-storytelling-template-js/raw/master/Storytelling-MapTour-2.2.zip), it contains the following files:
To use the downloadable version, download the [User Download archive](https://github.com/Esri/map-tour-storytelling-template-js/raw/master/Storytelling-MapTour-2.2.1.zip), it contains the following files:

| File | Contains |
| ------------------------------------------ | --------------------------------------------------------------------- |
Expand Down Expand Up @@ -183,7 +183,7 @@ Yes, web map designed for the previous version should continue to work without a
### Can I deploy Map Tour on Portal for ArcGIS?
Yes, Map Tour is included in Portal for ArcGIS 10.2.1. Note that for technical reason, the Feature Service creation isn't yet available from the interactive builder. If you want to use a Feature Service, please consult [this section](#using-an-existing-feature-service-map-service-or-shapefile).

If you use an older version of Portal, you can [download](https://github.com/Esri/map-tour-storytelling-template-js/raw/master/Storytelling-MapTour-2.2.zip) and deploy the template in the following folder `ArcGIS\Portal\webapps\arcgis#home\webmap\templates\MapTour`. This folder may already contain a non-functional version of the template. If this is the case, remove the folder's content before copying the new files. Then refer your Portal documentation for instructions on publishing a new web application item and adding it to the web application gallery. If you choose to deploy the template in any other folder, some configuration will be required (see index.html configuration). Also note that the web application gallery preview feature won't be functional and give a 404 error.
If you use an older version of Portal, you can [download](https://github.com/Esri/map-tour-storytelling-template-js/raw/master/Storytelling-MapTour-2.2.1.zip) and deploy the template in the following folder `ArcGIS\Portal\webapps\arcgis#home\webmap\templates\MapTour`. This folder may already contain a non-functional version of the template. If this is the case, remove the folder's content before copying the new files. Then refer your Portal documentation for instructions on publishing a new web application item and adding it to the web application gallery. If you choose to deploy the template in any other folder, some configuration will be required (see index.html configuration). Also note that the web application gallery preview feature won't be functional and give a 404 error.

### Can the template be used offline?
Yes, by using Portal for ArcGIS. When deployed on a Portal for ArcGIS instance, the Map Tour doesn't require any external service to function. But by default the template will still include the header social buttons and template publishers are able to import pictures from the some online pictures hosting services. These options can be disabled individually through the configuration file app/maptour-config.js.
Expand Down Expand Up @@ -306,6 +306,13 @@ It is possible to open the Map Tour on a specific point and not on the first one

## What's new?

#### Map Tour 2.2.1 released on 12/13/2013

Minor bug-fixes release:
* Interactive builder corrupt webmaps that uses Bing Maps basemaps

There is no need to upgrade existing application if you are not affected by that specific issue.

#### Map Tour 2.2 released on 12/10/2013

Major changes:
Expand Down Expand Up @@ -552,7 +559,7 @@ Download and unzip the [Developer download](https://github.com/Esri/map-tour-sto
| **MapTour/src/** | The application source code |
| **MapTour/deploy/** | The ready to be deployed Map Tour application |
| samples/ | Sample data layer to create your webmap |
| Storytelling-MapTour-2.2.zip | User download archive |
| Storytelling-MapTour-2.2.1.zip | User download archive |
| Readme.pdf | The detailed readme guide |
| Readme.md | This document |
| map-tour-storytelling-template-js.png | The application screenshot |
Expand Down
Binary file added Storytelling-MapTour-2.2.1.zip
Binary file not shown.

0 comments on commit e25889b

Please sign in to comment.