POST
|
Hi all, I am trying to use JQuery and bootstrap in my application but cant seem to make it work. I get: "Error: MultipleDefine". Any idea why? jsbin is here. Thanks, Alex
... View more
10-21-2015
04:45 PM
|
0
|
4
|
3437
|
POST
|
As you can see on JSbin, I am experiencing about the same problem: https://jsbin.com/zomerizeme/edit?html,output
... View more
10-15-2015
06:30 PM
|
0
|
2
|
289
|
POST
|
I am actually running it from my localhost on my IIS7.5 (in domain registered computer). And using my own Server's URL. Any idea?
... View more
10-15-2015
04:32 PM
|
0
|
0
|
289
|
POST
|
Looking at your script seems like that is exactly what I am after. (Pretty impressed by your JQuery skills by the way - i am trying to learn some) .The only thing I don't understand here is that I get a blank page just like your previous script. Is there a reason I would need a proxy? I do not have any locked services. Thanks, Alex
... View more
10-15-2015
04:13 PM
|
0
|
2
|
1020
|
POST
|
That is exactly what I want. Dropdown menu with "folders" name. Once folder is selected then the select event returns all services within the selected folder.
... View more
10-15-2015
03:37 PM
|
0
|
0
|
1020
|
POST
|
Thanks Robert ! That looks like a great script but I was trying to populate the select picker with the REST endpoint folders so the user can select the folder of his choice and populate a table with all the services from the folder of chosen by the user (dropdown). Layers might be an addition I would consider in the future though. Also, when I run your script, I get that I need a proxy... Not too sure why as our data is all unlocked (not secured) as it is behind the firewall. Thanks, Alex
... View more
10-15-2015
02:03 PM
|
0
|
2
|
1020
|
POST
|
You can find my code here: https://jsbin.com/sizufoxero/edit?html,output
... View more
10-12-2015
12:43 PM
|
0
|
4
|
1020
|
POST
|
Hi all, I am trying to build this application that lists all web services within each ArcGIS Server folders. I am trying to programmatically feed a drop down list with ArcGIS Server folder's names so the user just has to select the folder of his choice and it returns all services in a table. The following code works great but I had to manually enter each folder: <!DOCTYPE html>
<html>
<head>
<title>Service Info</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css">
<style>
html, body, #details {
padding: 0;
margin: 0;
height: 100%;
}
.dgrid-cell-padding {
padding: 10px !important;
}
.dgrid {
height: 100% !important;
}
.dgrid-cell{
border:1px solid black !important;
}
</style>
<script src="http://js.arcgis.com/3.14/"></script>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>
<script>
require([
"esri/request",
"dojo/_base/array",
"dojo/dom",
"dojo/domReady!"
], function (esriRequest, array, dom, Grid) {
$(document).ready(function () {
var baseUrl = "http://webgisdevint1/arcgis/rest/services";
$('.selectpicker').on('change', function(){
var baseFolder = $(this).find("option:selected").val();
esriRequest({
url: baseUrl + "/" + baseFolder,
content: {
"f": "json"
},
callbackParamName: "callback"
}).then(function (response) {
var data = array.map(response.services, function (service, index) {
return {
"url": "<a target='_blank' href='" + baseUrl + "/" + service.name + "/" + service.type + "'>" + baseUrl + "/" + service.name + "/" + service.type + "</a><br>",
"name": service.name,
"type": service.type,
"id": index
}
});
$('#example').DataTable({
destroy: true,
data: data,
columns: [
{ title:"URL", data: "url" },
{ title: "Name", data: "name" },
{ title: "Type", data: "type" }
]
});
});
});
});
});
</script>
</head>
<body class="claro">
<select class="selectpicker">
<option>Search web GIS Folders:</option>
<option>Alex_Try</option>
<option>CalMAPPER</option>
<option>davin</option>
<option>ForestPractice</option>
<option>FRAP</option>
<option>Pipeline</option>
<option>PPFIS</option>
<option>ResourceMgmt</option>
<option>System</option>
<option>testing</option>
<option>Utilities</option>
<option>WatershedMapper</option>
</select>
<table id="example" class="display" width="100%"></table>
</body>
</html> Any idea is more than welcome, Thanks, Alex
... View more
10-12-2015
10:31 AM
|
0
|
13
|
3853
|
POST
|
Last question related to this topic. How do I loop through each server's folder? Do I use ESRI/request -- folder.name? I am trying to use a drop down menu populated by each folder. Once selected by user then it fires the event of returning all services names. Thanks, Alex
... View more
10-09-2015
09:51 AM
|
0
|
0
|
1370
|
POST
|
Thant would work great ! That is exactly what I am looking for! Would it be hard to add the end result to a table? I m going to spend my day tomorrow looking for that now. Nicely done kelly! Thanks!
... View more
10-05-2015
04:19 PM
|
0
|
3
|
1370
|
POST
|
Hi all, I am trying to list out all the services names and URL and output it to an html table. I am doing so for each of the folders that we have in our ArcGIS Server. To accomplish that I am using ESRI/request module. I can retrieve the name of the service easy with this module, but can i also retrieve the URL? ESRI example that I am using: <!DOCTYPE html>
<html>
<head>
<title>Get ArcGIS Server Map Service Layer Field Names</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<style>
body{
font-family: "Arial Unicode MS, Arial, sans-serif";
}
#content {
width: 800px; height: 350px; padding: 5px; overflow: auto;
border: solid 2px #AAAAAA; background-color: #FFFFFF;
-moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px;
-moz-box-shadow: 0 0 0.5em black; -webkit-box-shadow: 0 0 0.5em black; -o-box-shadow: 0 0 0.5em black; box-shadow: 0 0 0.5em black;
}
.failure { color: red; }
#status { font-size: 12px; }
</style>
<script src="http://js.arcgis.com/3.14/"></script>
<script>
require(["dojo/dom", "dojo/on", "dojo/dom-class", "dojo/_base/json", "dojo/_base/array", "dojo/string", "esri/request", "dojo/domReady!"], function(dom, on, domClass, dojoJson, array, dojoString, esriRequest) {
dom.byId("url").value = "http://webgisdevint1/arcgis/rest/services/FRAP";
dom.byId("content").value = "";
//handle the Go button's click event
on(dom.byId("submitRequest"), "click", getContent);
function getContent(){
var contentDiv = dom.byId("content");
contentDiv.value = "";
domClass.remove(contentDiv, "failure");
dom.byId("status").innerHTML = "Downloading...";
//get the url and setup a proxy
var url = dom.byId("url").value;
if(url.length === 0){
alert("Please enter a URL");
return;
}
var requestHandle = esriRequest({
"url": url,
"content": {
"f": "json"
},
"callbackParamName": "callback"
});
requestHandle.then(requestSucceeded, requestFailed);
}
function requestSucceeded(response, io){
var fieldInfo, pad;
pad = dojoString.pad;
//toJson converts the given JavaScript object
//and its properties and values into simple text
dojoJson.toJsonIndentStr = " ";
console.log("response as text:\n", dojoJson.toJson(response,true));
dom.byId("status").innerHTML = "";
//show field names and aliases
if ( response.hasOwnProperty("services") ) {
console.log("got some services");
fieldInfo = array.map(response.services, function(f) {
return pad("", 0, " ", true) + pad(f.name, 0, " ", true)
});
dom.byId("content").value = fieldInfo.join("\n");
} else {
dom.byId("content").value = "No field info found. Please double-check the URL.";
}
}
function requestFailed(error, io){
domClass.add(dom.byId("content"), "failure");
dojoJson.toJsonIndentStr = " ";
dom.byId("content").value = dojoJson.toJson(error, true);
}
});
</script>
</head>
<body>
<p>Enter the URL for a layer in a map service to access metadata about a layer in a map service using esriRequest.</p>
<p>
<input type="text" id="url" size="105"/>
<input id="submitRequest" type="button" value="GO" />
<span id="status"></span>
</p>
<p>
<h2>Content</h2>
<p>Check the console for the full response. Here we'll display Field names, aliases and types:</p>
<textarea id="content"></textarea>
</p>
</body>
... View more
10-05-2015
11:28 AM
|
0
|
6
|
5711
|
Title | Kudos | Posted |
---|---|---|
1 | 10-31-2016 11:46 AM | |
1 | 10-15-2014 02:17 PM | |
1 | 11-19-2015 09:14 AM | |
1 | 10-29-2015 04:38 PM | |
1 | 02-02-2015 09:55 AM |
Online Status |
Offline
|
Date Last Visited |
11-05-2021
12:09 PM
|