Skip to content

Commit

Permalink
latest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Sep 9, 2016
1 parent 324fa6c commit 78f448a
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 61 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The GeoForm template can be accessed via the ArcGIS template gallery or item det
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.17"` and replace this portion of the reference with the url to your local install.
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.18"` 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.
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.

Expand Down
8 changes: 5 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
<!-- 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.17/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.17/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.18/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.18/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" />
<link href="js/vendor/select2/select2.min.css" rel="stylesheet" />
<link href="js/vendor/touch-spinner/jquery.bootstrap-touchspin.min.css" rel="stylesheet" type="text/css" />
<script src="js/vendor/jquery.min.js"></script>
<script src="js/vendor/moment-with-langs.min.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="js/vendor/html5shiv.min.js"></script>
Expand Down Expand Up @@ -72,7 +74,7 @@
dojoConfig.locale = RegExp.$1;
}
</script>
<script type="text/javascript" src="//js.arcgis.com/3.17"></script>
<script type="text/javascript" src="//js.arcgis.com/3.18"></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
62 changes: 40 additions & 22 deletions js/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ define([
locationSearchOption: null,

constructor: function (config, response) {
this._layerIds = [];
this.config = config;
this.response = response;
this.onDemandResources = [
Expand Down Expand Up @@ -275,12 +276,13 @@ define([
//support for all layers in webmap
if (evt.currentTarget.value === "all") {
domStyle.set(dom.byId("layerSelectPane"), 'display', 'block');
array.forEach(dom.byId("layerSelect").options, lang.hitch(this, function (opt) {
this._populateFields(opt.value);
this._updateAppConfiguration("fields", opt.value);
this.previousValue = opt.value;
array.forEach(dom.byId("layerSelect").options, lang.hitch(this, function (opt, i) {
if(i === 0){
this._populateFields(opt.value);
this._updateAppConfiguration("fields", opt.value);
this.previousValue = opt.value;
}
}));
dom.byId("layerSelect")[dom.byId("layerSelect").options.length - 1].selected = true;
this.currentConfig.form_layer.id = "all";
$("#ShowHideLayerOption")[0].disabled = true;
} else if (evt.currentTarget.value !== "") {
Expand Down Expand Up @@ -312,9 +314,11 @@ define([
}));

on(dom.byId("layerSelect"), "change", lang.hitch(this, function (evt) {
this._updateAppConfiguration("fields", this.previousValue);
this._populateFields(evt.currentTarget.value);
this.previousValue = evt.currentTarget.value;
var value = evt.target.value;
this._updateAppConfiguration("fields", this._layerSelectValue);
this._populateFields(value);
this._layerSelectValue = value;
this.previousValue = value;
}));
on(dom.byId('selectAll'), "change", lang.hitch(this, function (evt) {
array.forEach(query(".fieldCheckbox"), lang.hitch(this, function (currentCheckBox) {
Expand Down Expand Up @@ -494,16 +498,17 @@ define([
} else {
if (isLoadRequired) {
if (dom.byId("selectLayer").options.length > 2) {
array.forEach(dom.byId("layerSelect").options, lang.hitch(this, function (opt) {
this._populateFields(opt.value);
this._updateAppConfiguration("fields", opt.value);
this.previousValue = opt.value;
array.forEach(dom.byId("layerSelect").options, lang.hitch(this, function (opt, i) {
if(i === 0){
this._populateFields(opt.value);
this._updateAppConfiguration("fields", opt.value);
this.previousValue = opt.value;
}
}));
dom.byId("selectLayer").options[dom.byId("selectLayer").length - 1].selected = true;
}
domAttr.set(dom.byId("selectLayer"), "disabled", false);
domStyle.set(dom.byId("layerSelectPane"), 'display', 'block');
dom.byId("layerSelect")[dom.byId("layerSelect").options.length - 1].selected = true;
this.currentConfig.form_layer.id = "all";
} else {
this.previousValue = this.currentConfig.form_layer.id;
Expand Down Expand Up @@ -1138,8 +1143,12 @@ define([
}));
if (this.currentConfig.form_layer.id == "all") {
domStyle.set(dom.byId("layerSelectPane"), "display", "block");
var counter = 0;
for (var key in this.fieldInfo) {
this._populateFields(key);
if( counter === 0){
this._populateFields(key);
counter++;
}
}
} else {
this._populateFields(this.currentConfig.form_layer.id);
Expand All @@ -1152,14 +1161,23 @@ define([
_validateFeatureServer: function (layer, canCreate, layerId) {
if (canCreate && layer.geometryType === 'esriGeometryPoint') {
var filteredLayer, fLayer;
filteredLayer = document.createElement("option");
fLayer = document.createElement("option");
filteredLayer.text = fLayer.text = layer.name;
filteredLayer.value = fLayer.value = layerId;
filteredLayer = domConstruct.create("option", {
textContent: layer.name,
value: layerId
});
fLayer = domConstruct.create("option", {
textContent: layer.name,
value: layerId
});
if(!this._layerSelectValue){
domAttr.set(filteredLayer, "selected", "selected");
domAttr.set(fLayer, "selected", "selected");
this._layerSelectValue = layerId;
}
this.previousValue = layerId;
dom.byId("selectLayer").appendChild(filteredLayer);
dom.byId("layerSelect").appendChild(fLayer);
fLayer.selected = true;
this.previousValue = layerId;
this._layerIds.push(layerId);
this.fieldInfo[layerId] = {};
this.fieldInfo[layerId].Fields = layer.fields;
this.fieldInfo[layerId].layerUrl = layer.url;
Expand Down Expand Up @@ -1276,7 +1294,7 @@ define([
this.currentConfig.viewSubmissionsText = dom.byId("viewSubmissionsText").value;
break;
case "fields":
if (layerObj !== "all") {
if(layerObj && layerObj !== "all") {
var innerObj = [];
var fieldName, fieldLabel, fieldDescription, visible, preventPast, preventFuture, setCurrentDate, hiddenDate;
this.currentSelectedLayer[layerObj] = dom.byId('geoFormFieldsTable');
Expand Down Expand Up @@ -1385,7 +1403,7 @@ define([
this._addProgressBar();
$("#myModal").modal('show');
arcgisUtils.getItem(this.currentConfig.appid).then(lang.hitch(this, function (response) {
var updateURL = this.userInfo.portal.url + "/sharing/rest/content/users/" + this.userInfo.username + (response.item.ownerFolder ? ("/" + response.item.ownerFolder) : "") + "/items/" + this.currentConfig.appid + "/update";
var updateURL = this.userInfo.portal.url + "/sharing/rest/content/users/" + response.item.owner + (response.item.ownerFolder ? ("/" + response.item.ownerFolder) : "") + "/items/" + this.currentConfig.appid + "/update";
esriRequest({
url: updateURL,
content: rqData,
Expand Down
34 changes: 30 additions & 4 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,19 @@ define([
var utmResults = [];
usng.LLtoUTM(lat, lng, utmResults);
if (utmResults && utmResults.length === 3) {
dom.byId('utm_easting').value = parseInt(utmResults[0]);
dom.byId('utm_northing').value = parseInt(utmResults[1]);
dom.byId('utm_zone_number').value = utmResults[2];
var northing = parseFloat(utmResults[1]);
var easting = parseFloat(utmResults[0]);
var zone = parseInt(utmResults[2], 10);
if(northing < 0){
zone += "S";
northing = Math.abs(northing);
}
else{
zone += "N";
}
dom.byId('utm_easting').value = easting;
dom.byId('utm_northing').value = northing;
dom.byId('utm_zone_number').value = zone;
}
} catch (e) {
console.log(e);
Expand Down Expand Up @@ -1972,7 +1982,23 @@ define([
this._clearSubmissionGraphic();
var northing = parseFloat(dom.byId('utm_northing').value);
var easting = parseFloat(dom.byId('utm_easting').value);
var zone = parseInt(dom.byId('utm_zone_number').value, 10);

var zoneNode = dom.byId('utm_zone_number');
var zoneString = zoneNode.value;

var zoneLastChar = zoneString.substr(zoneString.length-1);

var zone = parseInt(zoneString, 10);

if(isNaN(zoneLastChar)){
if(zoneLastChar.toLowerCase() === "s"){
northing = -Math.abs(northing);
}
}
else{
northing = Math.abs(northing);
}

var converted = {};
try {
usng.UTMtoLL(northing, easting, zone, converted);
Expand Down
16 changes: 8 additions & 8 deletions js/nls/he/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ define({
"contentLabel": "התוכן שלי",
"favoritesLabel": "המועדפים שלי"
},
"title": "בחר מפת אינטרנט",
"title": "בחר Web Map",
"searchTitle": "חפש",
"ok": "אישור",
"cancel": "ביטול",
Expand Down Expand Up @@ -72,7 +72,7 @@ define({
"shareUserTextMessage": "הצע לאחרים לתרום באמצעות האפשרויות הבאות.",
"addAttachmentFailedMessage": "לא ניתן להוסיף קובץ לשכבה",
"addFeatureFailedMessage": "לא ניתן להוסיף ישות לשכבה",
"noLayerConfiguredMessage": "אירעה שגיאה בטעינה או באיתור של שכבת ישויות שניתן לערוך. כדי להציג את הטופס ולהתחיל לאסוף הגשות, הוסף למפת האינטרנט שכבת ישויות שניתן לערוך.",
"noLayerConfiguredMessage": "אירעה שגיאה בטעינה או באיתור של שכבת ישויות שניתן לערוך. כדי להציג את הטופס ולהתחיל לאסוף הגשות, הוסף ל- Webmap שכבת ישויות הניתנת לעריכה.",
"placeholderLatitude": "רוחב (Y)",
"placeholderLongitude": "אורך (X)",
"latitude": "רוחב",
Expand Down Expand Up @@ -132,13 +132,13 @@ define({
"configure": "קבע תצורה",
"configureField": "הגדר את השדה '${fieldName}'",
"invalidUser": "מצטערים, איך לך הרשאה לצפייה בפריט זה",
"invalidWebmapSelectionAlert": "מפת האינטרנט שנבחרה אינה מכילה שכבה חוקית לשימוש. הוסף למפת האינטרנט שכבת ישויות שניתן לערוך כדי שתוכל להמשיך.",
"invalidWebmapSelectionAlert": "מפת האינטרנט שנבחרה אינה מכילה שכבה חוקית לשימוש. הוסף ל- Webmapשכבת ישויות הניתנת לעריכה כדי שתוכל להמשיך.",
"invalidWebmapSelectionAlert2": "לקבלת מידע נוסף, ראה ${openLink}מהו שירות ישויות?${closeLink}",
"selectFieldsText": "בחר שדות טופס",
"selectThemeText": "בחר ערכת נושא לטופס",
"setViewerText": "הגדר חלון תצוגה",
"introText": "התחל",
"webmapText": "מפת אינטרנט",
"webmapText": "Webmap",
"layerText": "שכבה",
"detailsText": "פרטים",
"fieldsText": "שדות",
Expand All @@ -156,10 +156,10 @@ define({
"descriptionText": "GeoForm היא תבנית ניתנת להגדרה עבור עריכת נתונים מבוססת-טופס של ${link1}שירות ישויות${closeLink}. אפליקציה זו מאפשרת למשתמשים להזין נתונים דרך טופס במקום דרך חלון מוקפץ של מפה, תוך ניצול העוצמה של ${link2}מפת האינטרנט${closeLink} ושירותי הישויות הניתנים לעריכה. בצע את הפעולות הבאות כדי להתאים אישית ולפרוס את ה-GeoForm.",
"btnPreviousText": "הקודם",
"btnNextText": "הבא",
"webmapTabTitleText": "בחר מפת אינטרנט",
"viewWebmap": "הצג מפת אינטרנט",
"webmapDetailsText": "מפת האינטרנט שנבחרה היא ${webMapTitleLink}${webMapTitle}${closeLink}. כדי לבחור מפת אינטרנט אחרת, לחץ על לחצן 'בחר מפת אינטרנט'",
"btnSelectWebmapText": "בחר מפת אינטרנט",
"webmapTabTitleText": "בחר Webmap",
"viewWebmap": "הצג Webmap",
"webmapDetailsText": "webmap שנבחר הוא ${webMapTitleLink}${webMapTitle}${closeLink}. כדי לבחור webmap אחר, לחץ על לחצן 'בחר Webmap'",
"btnSelectWebmapText": "בחר Webmap",
"btnSelectWebmapTextLoading": "טוען&hellip;",
"layerTabTitleText": "בחר שכבות ניתנות לעריכה",
"selectLayerLabelText": "שכבה",
Expand Down
Loading

0 comments on commit 78f448a

Please sign in to comment.