Skip to content

Commit 34bc2d1

Browse files
committed
template update
1 parent ce873fd commit 34bc2d1

File tree

7 files changed

+27
-78
lines changed

7 files changed

+27
-78
lines changed

README.md

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,53 +24,13 @@ The PMG template is also easily configurable. A complete list of features and en
2424
1. To deploy this application, download the template from Portal/ArcGIS Online and unzip it.
2525
2. Copy the unzipped folder containing the web app template files, such as index.html, to your web server. You can rename the folder to change the URL through which users will access the application. By default the URL to the app will be `http://<Your Web Server>/<app folder name>/index.html`
2626
3. Change the sharing host, found in options.js inside the config folder for the application, to the sharing URL for ArcGIS Online or Portal. For ArcGIS Online users, keep the default value of www.arcgis.com or specify the name of your organization.
27-
- ArcGIS Online Example: `"sharingurl": location.protocol + "//" + “<your organization name>.maps.arcgis.com`
28-
- Portal Example where `arcgis` is the name of the Web Adaptor: `"sharingurl": location.protocol + "//" + "webadaptor.domain.com/arcgis"`
29-
4. If you are using Portal or a local install of the ArcGIS API for JavaScript, change all references to the ArcGIS API for JavaScript in index.html to refer to your local copy of the API. Search for the references containing `"//js.arcgis.com/3.20"` and replace this portion of the reference with the url to your local install.
30-
- For example: `"//webadaptor.domain.com/arcgis/jsapi/jsapi"` where `arcgis` is the name of your Web Adaptor.
27+
- ArcGIS Online Example: `"sharingurl": "https://" + “<your organization name>.maps.arcgis.com`
28+
- Portal Example where `arcgis` is the name of the Web Adaptor: `"sharingurl": "https://" + "webadaptor.domain.com/arcgis"`
29+
4. If you are using Portal or a local install of the ArcGIS API for JavaScript, change all references to the ArcGIS API for JavaScript in index.html to refer to your local copy of the API. Search for the references containing `"https://js.arcgis.com/3.21"` and replace this portion of the reference with the url to your local install.
30+
- For example: `"https://webadaptor.domain.com/arcgis/jsapi/jsapi"` where `arcgis` is the name of your Web Adaptor.
3131
5. Copy a map or group ID from Portal/ArcGIS Online and replace the default web map ID in the application’s index.html page. You can now run the application on your web server or customize the application further.
3232

33-
### Deployment Notes
34-
35-
#### Secure feature services
36-
If your application edits features in a feature service, contains secure services or web maps that aren't shared publicly, or generate requests that exceed 200 characters, you may need to set up and use a proxy page. Common situations where you may exceed the URL length are using complex polygons as input to a task or specifying a spatial reference using well-known text (WKT). For details on installing and configuring a proxy page see [Using the proxy](https://developers.arcgis.com/javascript/jshelp/ags_proxy.html). If you do not have an Internet connection, you will need to access and deploy the ArcGIS API for JavaScript documentation from [developers.arcgis.com](https://developers.arcgis.com/).
37-
38-
#### Caching
39-
After altering JavaScript files, you may encounter caching prohibiting you and/or users from seeing updates without refreshing the page multiple times.
40-
41-
To prevent caching with a deployment you could either:
42-
43-
* Implement versioning on individual JavaScript files in the **[javascript/home.js](https://github.com/Esri/map-gallery-template-js/blob/master/javascript/home.js#L12)** and **[javascript/map.js](https://github.com/Esri/map-gallery-template-js/blob/master/javascript/map.js#L14)** files:
44-
45-
```javascript
46-
//"application/common", //Current
47-
"application/common?version=1.0", //After implementation
48-
```
49-
50-
* **or** Implement [Dojo's cacheBurst](https://dojotoolkit.org/documentation/tutorials/1.10/dojo_config) (`cacheBust: true`) to the **[javascript/djConfig.js](https://github.com/Esri/map-gallery-template-js/blob/master/javascript/djConfig.js)** file to avoid module caching:
51-
52-
```javascript
53-
// Dojo Config with cacheBust
54-
var dojoConfig = {
55-
parseOnLoad: true,
56-
cacheBust: true, //Add cacheBust and set to true
57-
packages: [{
58-
name: "esriTemplate",
59-
location: path_location
60-
}, {
61-
name: "application",
62-
location: path_location + '/javascript'
63-
}, {
64-
name: "templateConfig",
65-
location: path_location_tc
66-
}, {
67-
name: "config",
68-
location: path_location + '/config'
69-
}]
70-
};
71-
```
72-
73-
However, caching can be a good thing and speed up the initial load of an application, keep this in mind if you implement either option.
33+
> **Note:** If your application edits features in a feature service, contains secure services or web maps that aren't shared publicly, or generate requests that exceed 200 characters, you may need to set up and use a proxy page. Common situations where you may exceed the URL length are using complex polygons as input to a task or specifying a spatial reference using well-known text (WKT). For details on installing and configuring a proxy page see [Using the proxy](https://developers.arcgis.com/javascript/jshelp/ags_proxy.html). If you do not have an Internet connection, you will need to access and deploy the ArcGIS API for JavaScript documentation from [developers.arcgis.com](https://developers.arcgis.com/).
7434
7535
[New to Github? Get started here.](https://github.com/)
7636

@@ -110,4 +70,3 @@ See the License for the specific language governing permissions and
11070
limitations under the License.
11171

11272
A copy of the license is available in the repository's [license.txt](https://raw.github.com/Esri/map-gallery-template-js/master/license.txt) file.
113-

config/commonConfig.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ define(
55
bingMapsKey: "ArAavTvIHoG3w9HwhroJuCFAzUttY_pQQvjdmHmZHQQfv6wahgxcyOiT3op-SCni",
66
helperServices: {
77
geometry: {
8-
url: location.protocol + "//utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
8+
url: "https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
99
},
1010
printTask: {
11-
url: location.protocol + "//utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
11+
url: "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
1212
},
1313
geocode: [{
14-
url: location.protocol + "//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"
14+
url: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"
1515
}]
1616
}
1717
};

index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta charset="utf-8" />
66
<meta name="fragment" content="!">
77
<title></title>
8-
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
98
<meta name="Keywords" content="" />
109
<meta name="Description" content="" />
1110
<!-- iOS -->
@@ -19,8 +18,8 @@
1918
<meta property="og:site_name" content="esri" />
2019
<!-- End Facebook -->
2120
<!-- STYLESHEETS -->
22-
<link rel="stylesheet" href="//js.arcgis.com/3.20/dijit/themes/claro/claro.css">
23-
<link href="//js.arcgis.com/3.20/dojox/form/resources/Rating.css" rel="stylesheet" />
21+
<link rel="stylesheet" href="https://js.arcgis.com/3.21/dijit/themes/claro/claro.css">
22+
<link href="https://js.arcgis.com/3.21/dojox/form/resources/Rating.css" rel="stylesheet" />
2423
<link href="css/reset.css" rel="stylesheet" type="text/css" />
2524
<link href="css/960.css" rel="stylesheet" type="text/css" />
2625
<link href="css/common.css" rel="stylesheet" type="text/css" />
@@ -72,7 +71,7 @@ <h1 id="homeHeading"></h1>
7271
<div id="footer"></div>
7372
<!-- JAVASCRIPT -->
7473
<script type="text/javascript" src="javascript/djConfig.js"></script>
75-
<script type="text/javascript" src="//js.arcgis.com/3.20"></script>
74+
<script type="text/javascript" src="https://js.arcgis.com/3.21"></script>
7675
<script type="text/javascript">
7776
require(["application/home"], function (App) {
7877
var myApp = App();

javascript/common.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ define([
7070
}
7171
if (appLocation !== -1) { //hosted or portal
7272
var instance = location.pathname.substr(0, appLocation);
73-
this._options.sharingurl = location.protocol + "//" + location.host + instance;
74-
this._options.proxyUrl = location.protocol + '//' + location.host + instance + "/sharing/proxy";
73+
this._options.sharingurl = "https://" + location.host + instance;
74+
this._options.proxyUrl = 'https://' + location.host + instance + "/sharing/proxy";
7575
//check sign-in status
7676
IdentityManager.checkSignInStatus(this._options.sharingurl + "/sharing").then(
7777
lang.hitch(this, function (credential) {
@@ -276,16 +276,16 @@ define([
276276
}
277277

278278
if (this._options.sharingurl) { //sharing url specified
279-
this._options.mobilePortalUrl = 'arcgis:' + '//' + location.host;
279+
this._options.mobilePortalUrl = 'arcgis://' + location.host;
280280
//sharing url set in config file so use default services
281281
} else if (appLocation !== -1) { //hosted or portal
282282
this._options.isOrg = true;
283283
var instance = location.pathname.substr(0, appLocation);
284-
this._options.sharingurl = location.protocol + "//" + location.host + instance;
285-
this._options.proxyurl = location.protocol + '//' + location.host + instance + "/sharing/proxy";
286-
this._options.mobilePortalUrl = 'arcgis:' + '//' + location.host;
284+
this._options.sharingurl = "https://" + location.host + instance;
285+
this._options.proxyurl = 'https://' + location.host + instance + "/sharing/proxy";
286+
this._options.mobilePortalUrl = 'arcgis://' + location.host;
287287
} else { //default to arcgis.com
288-
this._options.sharingurl = location.protocol + "//" + "www.arcgis.com";
288+
this._options.sharingurl = "https://www.arcgis.com";
289289
this._options.mobilePortalUrl = "arcgis://www.arcgis.com";
290290
}
291291
arcgisUtils.arcgisUrl = this._options.sharingurl + "/sharing/rest/content/items";
@@ -436,11 +436,7 @@ define([
436436
html += '<a class="addthis_counter addthis_bubble_style"></a>';
437437
html += '</div>';
438438
// addthis url
439-
var addthisURL = "http://s7.addthis.com/js/250/addthis_widget.js#pubid=";
440-
// https support
441-
if (addthisURL && location.protocol === "https:") {
442-
addthisURL = addthisURL.replace('http:', 'https:');
443-
}
439+
var addthisURL = "https://s7.addthis.com/js/250/addthis_widget.js#pubid=";
444440
// load share script
445441
ioScript.get({
446442
url: addthisURL + this._options.addThisProfileId

javascript/home.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,7 @@ define([
465465
modifiedDate = new Date(data.results[i].modified);
466466
// date format for locale
467467
modifiedLocalized = locale.format(modifiedDate, {
468-
selector: "date",
469-
datePattern: i18n.viewer.main.datePattern
468+
selector: "date"
470469
});
471470
}
472471
// html

javascript/map.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ define([
481481
var commentDate = new Date(this.globalComments[i].created);
482482
// date format for locale
483483
var dateLocale = locale.format(commentDate, {
484-
selector: "date",
485-
datePattern: i18n.viewer.main.datePattern
484+
selector: "date"
486485
});
487486
html += i18n.viewer.comments.posted + ' ' + dateLocale;
488487
html += ' ' + i18n.viewer.comments.by + ' ';
@@ -796,8 +795,7 @@ define([
796795
d = new Date(itemInfo.item.created);
797796
// date format for locale
798797
dateLocale = locale.format(d, {
799-
selector: "date",
800-
datePattern: i18n.viewer.main.datePattern
798+
selector: "date"
801799
});
802800
html += '<li><strong>' + i18n.viewer.mapPage.createdLabel + '</strong><br />' + dateLocale + '</li>';
803801
}
@@ -807,8 +805,7 @@ define([
807805
d = new Date(itemInfo.item.modified);
808806
// date format for locale
809807
dateLocale = locale.format(d, {
810-
selector: "date",
811-
datePattern: i18n.viewer.main.datePattern
808+
selector: "date"
812809
});
813810
html += '<li><strong>' + i18n.viewer.itemInfo.modifiedLabel + '</strong><br />' + dateLocale + '</li>';
814811
}

map.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta charset="utf-8" />
66
<meta name="fragment" content="!">
77
<title></title>
8-
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
98
<meta name="Keywords" content="" />
109
<meta name="Description" content="" />
1110
<!-- iOS -->
@@ -19,9 +18,9 @@
1918
<meta property="og:site_name" content="esri" />
2019
<!-- End Facebook -->
2120
<!-- STYLESHEETS -->
22-
<link rel="stylesheet" href="//js.arcgis.com/3.20/dijit/themes/claro/claro.css">
23-
<link rel="stylesheet" href="//js.arcgis.com/3.20/esri/css/esri.css">
24-
<link href="//js.arcgis.com/3.20/dojox/form/resources/Rating.css" rel="stylesheet" />
21+
<link rel="stylesheet" href="https://js.arcgis.com/3.21/dijit/themes/claro/claro.css">
22+
<link rel="stylesheet" href="https://js.arcgis.com/3.21/esri/css/esri.css">
23+
<link href="https://js.arcgis.com/3.21/dojox/form/resources/Rating.css" rel="stylesheet" />
2524
<link href="css/reset.css" rel="stylesheet" type="text/css" />
2625
<link href="css/960.css" rel="stylesheet" type="text/css" />
2726
<link href="css/common.css" rel="stylesheet" type="text/css" />
@@ -101,7 +100,7 @@ <h2 id="legendHeader"></h2>
101100
<div id="footer"></div>
102101
<!-- JAVASCRIPT -->
103102
<script type="text/javascript" src="javascript/djConfig.js"></script>
104-
<script type="text/javascript" src="//js.arcgis.com/3.20"></script>
103+
<script type="text/javascript" src="https://js.arcgis.com/3.21"></script>
105104
<script type="text/javascript">
106105
require(["application/map"], function (App) {
107106
App();

0 commit comments

Comments
 (0)