Skip to content

Commit

Permalink
Template update
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Jun 28, 2017
1 parent 74099ab commit 13d489a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ The GeoForm template can be accessed via the ArcGIS template gallery or item det
1. To deploy this application, download the template from Portal/ArcGIS Online and unzip it.
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`
3. Change the sharing host, found in defaults.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.
- ArcGIS Online Example: `"sharinghost": location.protocol + "//" + “<your organization name>.maps.arcgis.com`
- Portal Example where `arcgis` is the name of the Web Adaptor: `"sharinghost": location.protocol + "//" + "webadaptor.domain.com/arcgis"`
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.
- For example: `"//webadaptor.domain.com/arcgis/jsapi/jsapi"` where `arcgis` is the name of your Web Adaptor.
- ArcGIS Online Example: `"sharinghost": "https://" + “<your organization name>.maps.arcgis.com`
- Portal Example where `arcgis` is the name of the Web Adaptor: `"sharinghost": "https://" + "webadaptor.domain.com/arcgis"`
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.
- For example: `"https://webadaptor.domain.com/arcgis/jsapi/jsapi"` where `arcgis` is the name of your Web Adaptor.
5. Copy a map or group ID from Portal/ArcGIS Online and replace the default web map ID in the application’s defaults.js file. You can now run the application on your web server or customize the application further.

> **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/).
Expand Down
2 changes: 1 addition & 1 deletion config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ define({
//Enter the url to your organizations bing maps key if you want to use bing basemaps
"bingmapskey": "",
//Defaults to arcgis.com. Set this value to your portal or organization host name.
"sharinghost": location.protocol + "//" + "www.arcgis.com",
"sharinghost": "https://www.arcgis.com",
"units": null,
"useSmallHeader": false,
"enableSharing": true,
Expand Down
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<head>
<meta charset="utf-8">
<meta name="fragment" content="!">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Keywords" content="GeoForm, GeoForm Template, Template, Map, Esri">
<meta name="description" content="GeoForm is a configurable template for form based data editing of a Feature Service. This application allows users to enter data through a form instead of a map’s pop-up while leveraging the power of the Web Map and editable Feature Services.">
Expand All @@ -20,8 +19,8 @@
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" type="text/css" href="js/vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="js/vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.20/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.20/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.21/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.21/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="js/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link id="rtlCSS" rel="stylesheet" />
Expand Down Expand Up @@ -74,7 +73,7 @@
dojoConfig.locale = RegExp.$1;
}
</script>
<script type="text/javascript" src="//js.arcgis.com/3.20"></script>
<script type="text/javascript" src="https://js.arcgis.com/3.21"></script>
<script type="text/javascript" src="js/vendor/offline/offline.min.js"></script>
<script type="text/javascript" src="js/vendor/IndexedDBShim.min.js"></script>
<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion js/ShareModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ define([
this.set("shortenUrl", null);
var url = this.get("url");
// create base url
url = window.location.protocol + '//' + window.location.host + window.location.pathname;
url = 'https://' + window.location.host + window.location.pathname;
//Remove edit=true from the query parameters
if (location.href.indexOf("?") > -1) {
var queryUrl = location.href;
Expand Down
2 changes: 1 addition & 1 deletion js/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ define([
type: "checkbox",
index: currentIndex
}, fieldCheckBox);
if (currentField.name == this.fieldInfo[layerName].typeIdField || !currentField.nullable) {
if (currentField.name == this.fieldInfo[layerName].typeIdField) {
domAttr.set(fieldCheckBoxInput, "checked", true);
domAttr.set(fieldCheckBoxInput, "disabled", true);
} else {
Expand Down
3 changes: 2 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ define([
}
}));
//Handle case where edit is first url parameter we'll use the same logic we used in ShareModal.js
var url = window.location.protocol + '//' + window.location.host + window.location.pathname;
var url = 'https://' + window.location.host + window.location.pathname;
if (window.location.href.indexOf("?") > -1) {
var queryUrl = window.location.href;
var urlParams = ioQuery.queryToObject(window.location.search.substring(1)),
Expand Down Expand Up @@ -1487,6 +1487,7 @@ define([
},
editable: true,
usePopupManager: false,
layerMixins: this.config.layerMixins || [],
bingMapsKey: this.config.bingKey
}).then(lang.hitch(this, function (response) {
// Once the map is created we get access to the response which provides important info
Expand Down
4 changes: 2 additions & 2 deletions js/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ define([
if (appLocation !== -1) {
// hosted or portal
instance = location.pathname.substr(0, appLocation); //get the portal instance name
this.config.sharinghost = location.protocol + "//" + location.host + instance;
this.config.proxyurl = location.protocol + "//" + location.host + instance + "/sharing/proxy";
this.config.sharinghost = "https://" + location.host + instance;
this.config.proxyurl = "https://" + location.host + instance + "/sharing/proxy";
}
}
arcgisUtils.arcgisUrl = this.config.sharinghost + "/sharing/rest/content/items";
Expand Down
7 changes: 3 additions & 4 deletions viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8">
<meta name="fragment" content="!">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Keywords" content="GeoForm, GeoForm Template, Template, Map, Esri">
<meta name="description" content="GeoForm is a configurable template for form based data editing of a Feature Service. This application allows users to enter data through a form instead of a map’s pop-up while leveraging the power of the Web Map and editable Feature Services.">
Expand All @@ -19,8 +18,8 @@
<!-- Bootstrap core CSS -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" type="text/css" href="js/vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.20/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.20/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.21/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.21/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="js/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link id="rtlCSS" rel="stylesheet" />
Expand Down Expand Up @@ -73,7 +72,7 @@
}
</script>
<link href="css/viewer.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="//js.arcgis.com/3.20"></script>
<script type="text/javascript" src="https://js.arcgis.com/3.21"></script>
<script type="text/javascript">
require(["config/templateConfig", "application/template", "application/viewer"], function (templateOptions, Template, viewer) {
// start template
Expand Down

0 comments on commit 13d489a

Please sign in to comment.