Skip to content

Commit

Permalink
Version 3.20 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyhutchins committed Mar 14, 2017
1 parent 6b4048c commit 82129a0
Show file tree
Hide file tree
Showing 15 changed files with 649 additions and 498 deletions.
4 changes: 2 additions & 2 deletions config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ define({
"customstyle": null,
"background": "#444",
"color": "#fff",
"legendTitleBackground": "#848484",
"legendTitleBackground": "#767676",
"subtitleColor": "#CECECE",
"legendTitleColor": "#fff",
"showTitle": true,
"showSubTitle": true,
"title": null,
Expand All @@ -46,7 +47,6 @@ define({
"socialLink": "http://storymaps.arcgis.com",
"socialText": "A story map",
"headerHeight": "115",
"embed": false,
"legend": true,
"legendOpen": false,
"scalebar": true,
Expand Down
3 changes: 2 additions & 1 deletion config/templateConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ define({
"marker",
"theme",
"sharedTheme", "sharedThemeItem",
"legendOpen"
"legendOpen",
"sharinghost"
],
// Most users will not need to modify this value. For esri hosting environments only. Will automatically create a "sharinghost" and "proxyurl" for the application. Only set this is to true if the app is going to be stored on Esri's hosting servers. If you are using your own custom hosted portal, set the "sharinghost" in defaults.js instead of setting this to true.
esriEnvironment: false
Expand Down
74 changes: 38 additions & 36 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html>

<head>
<title></title>
<meta charset="utf-8">
Expand All @@ -21,13 +22,14 @@
<meta name="description" content="This story map was created with the Story Map Basic application in ArcGIS Online.">

<!-- Facebook sharing -->
<meta property="og:type" content="article"/>
<meta property="og:title" content="Story Map Basic"/>
<meta property="og:description" content="This story map was created with the Story Map Basic application in ArcGIS Online."/>
<meta property="og:image" content="http://www.arcgis.com/apps/OnePane/storytelling_basic/images/esriGlobeLogow.png"/>
<meta property="og:type" content="article" />
<meta property="og:title" content="Story Map Basic" />
<meta property="og:description" content="This story map was created with the Story Map Basic application in ArcGIS Online."
/>
<meta property="og:image" content="http://www.arcgis.com/apps/OnePane/storytelling_basic/images/esriGlobeLogow.png" />

<link rel="stylesheet" href="//js.arcgis.com/3.18/esri/themes/calcite/dijit/calcite.css">
<link rel="stylesheet" href="//js.arcgis.com/3.18/esri/themes/calcite/esri/esri.css">
<link rel="stylesheet" href="//js.arcgis.com/3.20/esri/themes/calcite/dijit/calcite.css">
<link rel="stylesheet" href="//js.arcgis.com/3.20/esri/themes/calcite/esri/esri.css">
<!-- Load any application specific styles -->
<link rel="stylesheet" href="css/main.css">
</head>
Expand All @@ -45,7 +47,7 @@ <h2 id="subtitle" class="ac"></h2>
</div>
<div class="socialArea">
<div class="linkSocialContainer">
<span id="linkContainer" class="ac linkContainer"</span>
<span id="linkContainer" class="ac linkContainer" </span>
<span class="shareBtns">
<i id="facebook" class="ac shareIcon blackHover share_facebook icon-facebook" tabindex="-1"></i>
<i id="twitter" class="ac shareIcon blackHover share_twitter icon-twitter" tabindex="-1"></i>
Expand All @@ -56,16 +58,16 @@ <h2 id="subtitle" class="ac"></h2>
<tr>
<td class="logoWrapper">
<a id="logoLink" class="logoLink" target="_blank" tabindex="-1">
<img id="logoImg" class="logoImg"/>
<img id="logoImg" class="logoImg" />
</a>
</td>
</tr>
</table>
</div>
</div>
<!-- Map Section -->
<div id="mapDiv" dojotype="dijit/layout/ContentPane" data-dojo-props="region:'center'" dir="ltr">
<div id="legendCon" dir="ltr">
<div id="mapDiv" dojotype="dijit/layout/ContentPane" data-dojo-props="region:'center'" dir="ltr">
<div id="legendCon" dir="ltr">
<div id="legendToggle" class="lbg">
<div class="fg" id="legTogText"></div>
<div id="legToggleIcon" class="fg icon-down toggle-icon"></div>
Expand All @@ -79,54 +81,54 @@ <h2 id="subtitle" class="ac"></h2>
var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'));
var dojoConfig = {
async: true,
parseOnLoad:true,
parseOnLoad: true,
// The locationPath logic below may look confusing but all its doing is
// enabling us to load the api from a CDN and load local modules from the correct location.
packages: [{
name: "application",
location: package_path + '/js'
}, {
}, {
name: "config",
location: package_path + '/config'
}, {
}, {
name: "arcgis_templates",
location: package_path + '/..'
}]
}]
};
// Have to handle a locale parameter before dojo is loaded
if (location.search.match(/locale=([\w\-]+)/)) {
dojoConfig.locale = RegExp.$1;
dojoConfig.locale = RegExp.$1;
}
</script>
<script type="text/javascript" src="//js.arcgis.com/3.18/"></script>
<script type="text/javascript" src="//js.arcgis.com/3.20/"></script>
<script type="text/javascript">
require([
"config/templateConfig",
"application/template",
"application/main",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"
"config/templateConfig",
"application/template",
"application/main",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"
], function (
templateConfig,
Template,
Main
) {
// create the template. This will take care of all the logic required for template applications
var myTemplate = new Template(templateConfig);
// create my main application. Start placing your logic in the main.js file.
var myApp = new Main();
// start template
myTemplate.startup().then(function (config) {
// The config object contains the following properties: helper services, (optionally)
// i18n, appid, webmap and any custom values defined by the application.
// In this example we have one called theme.
myApp.startup(config);
}, function (error) {
// something went wrong. Let's report it.
myApp.reportError(error);
// create the template. This will take care of all the logic required for template applications
var myTemplate = new Template(templateConfig);
// create my main application. Start placing your logic in the main.js file.
var myApp = new Main();
// start template
myTemplate.startup().then(function (config) {
// The config object contains the following properties: helper services, (optionally)
// i18n, appid, webmap and any custom values defined by the application.
// In this example we have one called theme.
myApp.startup(config);
}, function (error) {
// something went wrong. Let's report it.
myApp.reportError(error);
});
});
});
</script>
</body>

</html>
</html>
15 changes: 10 additions & 5 deletions js/SearchSources.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dojo/_base/array", "dojo/_base
var mapLayer = this.map.getLayer(layer.id);
if (mapLayer && (mapLayer.type === "Feature Layer" || mapLayer.type === "FeatureLayer")) {
source.featureLayer = mapLayer;
if (mapLayer.infoTemplate) {
source.infoTemplate = mapLayer.infoTemplate;
}
} else {
source.featureLayer = new FeatureLayer(url, {
outFields: ["*"]
Expand All @@ -146,12 +149,11 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dojo/_base/array", "dojo/_base
source.locator = new Locator(source.url);
} else { //feature layer
var featureLayer = null;
if (source.flayerId && source.url) {
featureLayer = new FeatureLayer(source.url, {
outFields: ["*"]
});
} else if (source.flayerId) {
if (source.flayerId) {
featureLayer = this.map.getLayer(source.flayerId);
if (featureLayer && featureLayer.type !== "Feature Layer") {
featureLayer = null;
}
}
if (!featureLayer && source.url) {
featureLayer = new FeatureLayer(source.url, {
Expand All @@ -165,6 +167,9 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dojo/_base/array", "dojo/_base
}
}
source.featureLayer = featureLayer;
if (source.featureLayer && source.featureLayer.infoTemplate) {
source.infoTemplate = source.featureLayer.infoTemplate;
}
}
if (source.searchWithinMap) {
source.searchExtent = this.map.extent;
Expand Down
Loading

0 comments on commit 82129a0

Please sign in to comment.