POST
|
Maybe create a Spatial reference var sr = new SpatialReference(4326); and then when you create the map add it map = new Map("mapDiv", { showAttribution: false, sliderStyle: "small", extent: initialExtent, spatialReference: sr }); then the location will be the same as the SR of the map - because the map is now 4326
... View more
11-18-2014
08:31 AM
|
0
|
3
|
966
|
POST
|
Using Server Manager, in IIS, you can navigate to the site and under the HTTP Response Headers you can choose ADD, then title Access-Control-Allow-Origin and value is the IP or domain of the site you want to allow. Could always choose * for everyone. While you can do it in your code, Server side is probably the best option.
... View more
11-17-2014
07:42 AM
|
1
|
0
|
900
|
POST
|
If your service is tied to a webpage that you can modify, you could always script the analytic in to the page and ignore the server side.
... View more
11-17-2014
07:35 AM
|
1
|
1
|
372
|
POST
|
All I can think of is you need to restart the server or maybe it won't take effect until it writes a new log file for the next day.
... View more
11-16-2014
07:34 AM
|
1
|
3
|
372
|
POST
|
Yes. If you open Server Manager (usually and icon of toolbox and tower on the taskbar - otherwise run ServerManager.msc) and expand roles, webserver, double click Internet Information Services (IIS) manager. It will open another column that had the server name, application pools and sites folder. Click the server name. Then you should see the main window filled with some icons. under IIS, double clik Logging. Press the Select Fields button. You should have the option to add a bunch of fields and IP address is one - so is username.
... View more
11-14-2014
12:02 PM
|
1
|
5
|
680
|
POST
|
I am able to go to my server (yours http://213.6.3.171) and in my server manager I have a site called ArcGIS. This has the REST services. On that server I can go to C:\inetpub\logs\LogFiles\W3SVC1 and they are named u_exYYMMDD.txt (where YYMMDD = year/month/day). Don't know if this is because I have the web adapter or not.
... View more
11-14-2014
10:32 AM
|
1
|
9
|
680
|
POST
|
If you have access to the webserver you can query the log. You will have lines like this: 2014-07-11 17:54:20 xxx.xxx.xxx.xx GET /ArcGIS/rest/services/PaulFeaturewgs84/MapServer/0/query returnGeometry=true&outSR=4326&f=json&outFields=*&where=.. use the IP adress (the xx.xx.xx.x) to identify different users. Just look for your service string and parse the file. If user logged in, it should be in the log too.
... View more
11-14-2014
08:49 AM
|
1
|
11
|
680
|
POST
|
You can watch usage in the web server log, would just need to parse it out but would get lines like this: 2014-07-11 19:46:34 xxx.xxx.xxx.xx GET /ArcGIS/rest/services/featuretestproperties/FeatureServer/0/query returnGeometry=true&outSR=4326&f=json&outFields=*&where... you can also do some cool map tracking things like zoom and clicks and probably service info with Google Analytics too. Check out this video "Tracking Slippy Map Analytics" from Foss4g on Vimeo Tracking Slippy Map Analytics — Dustin Sampson on Vimeo
... View more
11-14-2014
08:04 AM
|
0
|
0
|
383
|
POST
|
I have a REST - ish service running that dumps a database. It looks like this: [{"division":"ADMIN","objectid":"18186","name":"Central Avenue Pedestrian and Lighting Improvements Project Phase II","pid":"DESIGN"},{"division":"CIP","objectid":"18149","name":"4th Street Roadway Improvements (Central to Tijeras)","pid":"CONSTRUCTION"},{"division":"CIP","objectid":"18152","name":"Alligator Courtyard Exhibit","pid":"CONSTRUCTION"},{"division":"CIP","objectid":"18574","name":"Convention Center Remodel Phase 2","pid":"CONSTRUCTION"},{"division":"CIP","objectid":"19020","name":"Edith Transfer Station","pid":"PROJECT_DEVELOPMENT"}] I then created a webpage that connects to this data and compares the user input. It prints out any name that sounds the same. I used resign so I could match the word DESIGN. You would have more words that match so it would print any that did. then here is the code. The architecture is like REST. You write a server side script to query your DB and put out the info in JSON. then the website uses AJAX to get the data and do the work client side. In my first example I used ArcServer because then you dont have to write the server side. the HTML is below and below that I have attached a sample server side script that would generate the JSON. <html> <head><title>Blank</title> <script src="http://myserver/JavaScript/ThirdParty/qwest/qwest-0.6.0.min.js"></script> </head> <body> Name: <input type="text" id="myText" > <button onclick='compareWords()'>Copy Text</button> <p id='data'></p> <script> var e; var compare; var sound; var response; var soundex = function (s) { var a = s.toLowerCase().split('') f = a.shift(), r = '', codes = { a: '', e: '', i: '', o: '', u: '', b: 1, f: 1, p: 1, v: 1, c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2, d: 3, t: 3, l: 4, m: 5, n: 5, r: 6 }; r = f + a .map(function (v, i, a) { return codes }) .filter(function (v, i, a) { return ((i === 0) ? v !== codes : v !== a[i - 1]); }) .join(''); return (r + '000').slice(0, 4).toUpperCase(); }; function compareWords(){ w=document.getElementById("myText").value; console.log(w); sound=soundex(document.getElementById("myText").value); qwest.get('http://myserver/myJSON.asp') .success(function(response){ for(i=0;i<response.length-1;i++){ e=response.pid; compare=soundex(response.pid); console.log(response.pid); console.log(compare); if(sound.substring(1) == compare.substring(1)){ console.log(e +" sounds like " +w ); var data = document.getElementById("data"); data.innerHTML+=e +"<br/>"; }else{console.log("nope");} } }) .error(function(message){ alert(message); }); } </script> </body> </html> Server side : need to populate your connection string wiht DB values for CAP variables <% set myconn_ = server.createobject("adodb.connection") connection_ = "Provider=sqloledb; Data Source=NAME; Initial Catalog=DBNAME;User Id=USER; Password=PASSWORD;Network Library=DBMSSOCN" myconn_.open (connection_) set result_ = server.createobject("adodb.recordset") sql = "Select distinct something from some table" set result_ = myconn_.execute(sql) Response.ContentType = "application/json" response.write("[") while not result_.EOF response.write("{""division"":""" & result_("Division")&""",""objectid"":"""& result_("objectid") &""",""name"":"""& result_("ProjectName") &""",""pid"":"""& result_("Project_Status") &"""},") result_.movenext() wend response.write(" {""division"":"" " & 9 &""",""objectid"":"""& 9 &" "",""name"":"""& 9 &" "",""status"":"""& 9 &"""}]") result_.close myconn_.close set result_ = Nothing set myconn_ = Nothing response.end %>
... View more
11-13-2014
03:35 PM
|
0
|
0
|
2201
|
POST
|
Lastly, another soundex library. <html> <head><title>soundex</title> </head> <body> <script> /* * v 1.0e NEEDS TESTING * ----------------------- * * The following SoundEx function is: * * (C) Copyright 2002 - 2013, Creativyst, Inc. * ALL RIGHTS RESERVED * * For more information go to: * http://www.Creativyst.com * or email: * Support@Creativyst.com * * Redistribution and use in source and binary * forms, with or without modification, are * permitted provided that the following conditions * are met: * * 1. Redistributions of source code must * retain the above copyright notice, this * list of conditions and the following * disclaimer. * * 2. Redistributions in binary form must * reproduce the above copyright notice, * this list of conditions and the * following disclaimer in the * documentation and/or other materials * provided with the distribution. * * 3. All advertising materials mentioning * features or use of this software must * display the following acknowledgement: * This product includes software developed * by Creativyst, Inc. * * 4. The name of Creativyst, Inc. may not be * used to endorse or promote products * derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CREATIVYST CORPORATION * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ function SoundEx(WordString, LengthOption, CensusOption) { var TmpStr; var WordStr = ""; var CurChar; var LastChar; var SoundExLen = 10; var WSLen; var FirstLetter; if(CensusOption) { LengthOption = 4; } if(LengthOption != undefined) { SoundExLen = LengthOption; } if(SoundExLen > 10) { SoundExLen = 10; } if(SoundExLen < 4) { SoundExLen = 4; } if(!WordString) { return(""); } WordString = WordString.toUpperCase(); /* Clean and tidy */ WordStr = WordString; WordStr = WordStr.replace(/[^A-Z]/gi, " "); // rpl non-chars w space WordStr = WordStr.replace(/^\s*/g, ""); // remove leading space WordStr = WordStr.replace(/\s*$/g, ""); // remove trailing space /* Some of our own improvements */ if(!CensusOption) { /* v1.0e: GH at begining of word has G-sound (e.g., ghost) */ WordStr = WordStr.replace(/^GH/g, "G"); // Chng leadng GH to G WordStr = WordStr.replace(/DG/g, "G"); // Change DG to G WordStr = WordStr.replace(/GH/g, "H"); // Change GH to H WordStr = WordStr.replace(/GN/g, "N"); // Change GN to N WordStr = WordStr.replace(/KN/g, "N"); // Change KN to N WordStr = WordStr.replace(/PH/g, "F"); // Change PH to F WordStr = WordStr.replace(/MP([STZ])/g, "M$1"); // MP if fllwd by ST|Z WordStr = WordStr.replace(/^PS/g, "S"); // Chng leadng PS to S WordStr = WordStr.replace(/^PF/g, "F"); // Chng leadng PF to F WordStr = WordStr.replace(/MB/g, "M"); // Chng MB to M WordStr = WordStr.replace(/TCH/g, "CH"); // Chng TCH to CH } /* The above improvements may * have changed this first letter */ FirstLetter = WordStr.substr(0,1); /* in case 1st letter is * an H or W and we're in * CensusOption = 1 */ if(FirstLetter == "H" || FirstLetter == "W") { TmpStr = WordStr.substr(1); WordStr = "-"; WordStr += TmpStr; } /* In properly done census * SoundEx the H and W will * be squezed out before * performing the test * for adjacent digits * (this differs from how * 'real' vowels are handled) */ if(CensusOption == 1) { WordStr = WordStr.replace(/[HW]/g, "."); } /* Begin Classic SoundEx */ WordStr = WordStr.replace(/[AEIOUYHW]/g, "0"); WordStr = WordStr.replace(/[BPFV]/g, "1"); WordStr = WordStr.replace(/[CSGJKQXZ]/g, "2"); WordStr = WordStr.replace(/[DT]/g, "3"); WordStr = WordStr.replace(/ /g, "4"); WordStr = WordStr.replace(/[MN]/g, "5"); WordStr = WordStr.replace(/ /g, "6"); /* Properly done census: * squeze H and W out * before doing adjacent * digit removal. */ if(CensusOption == 1) { WordStr = WordStr.replace(/\./g, ""); } /* Remove extra equal adjacent digits */ WSLen = WordStr.length; LastChar = ""; TmpStr = ""; // removed v10c djr: TmpStr = "-"; /* rplcng skipped first char */ for(i = 0; i < WSLen; i++) { CurChar = WordStr.charAt(i); if(CurChar == LastChar) { TmpStr += " "; } else { TmpStr += CurChar; LastChar = CurChar; } } WordStr = TmpStr; WordStr = WordStr.substr(1); /* Drop first letter code */ WordStr = WordStr.replace(/\s/g, ""); /* remove spaces */ WordStr = WordStr.replace(/0/g, ""); /* remove zeros */ WordStr += "0000000000"; /* pad with zeros on right */ WordStr = FirstLetter + WordStr; /* Add first letter of word */ WordStr = WordStr.substr(0,SoundExLen); /* size to taste */ return(WordStr); } alert(SoundEx("paul")+" "+SoundEx("ball")); alert(SoundEx("paul").substring(1)+" "+SoundEx("ball").substring(1)) alert(SoundEx("car")+" "+SoundEx("truck")); alert(SoundEx("car").substring(1)+" "+SoundEx("truck").substring(1)) </script> </body> </html>
... View more
11-13-2014
11:00 AM
|
0
|
1
|
2201
|
POST
|
Here is a sample of a javascript webpage that queries arcServer, grabs the name of a specific feature and compared it to the word dead (the feature name is Lead). <html> <head><title>Blank</title> </head> <body> <script src="http://myserver/JavaScript/ThirdParty/qwest/qwest-0.6.0.min.js"></script> <script> //the soundex function var soundex = function (s) { var a = s.toLowerCase().split('') f = a.shift(), r = '', codes = { a: '', e: '', i: '', o: '', u: '', b: 1, f: 1, p: 1, v: 1, c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2, d: 3, t: 3, l: 4, m: 5, n: 5, r: 6 }; r = f + a .map(function (v, i, a) { return codes }) .filter(function (v, i, a) { return ((i === 0) ? v !== codes : v !== a[i - 1]); }) .join(''); return (r + '000').slice(0, 4).toUpperCase(); }; //an AJAX library to connect to arcserver, grab one feature name and compare qwest.post('http://dmdview/ArcGIS/rest/services/BikeWays_Trails/MapServer/0/query',{where:'objectid = 76',f:'json',outFields:'ParentPathName'}) .success(function(response){ compare=soundex(response.features[0].attributes.ParentPathName) word="dead"; sound=soundex(word); if(sound == compare){ alert(word+ " is similar to "+response.features[0].attributes.ParentPathName); }else if(sound.substring(1) == compare.substring(1)){ alert(word+ " is similar to "+response.features[0].attributes.ParentPathName); }else{ alert("nope");} }) .error(function(message){ alert(message); }); </script> </body> </html>
... View more
11-13-2014
10:54 AM
|
0
|
0
|
2201
|
POST
|
If you have arcServer you could run a query against the service with existing names and test it using JavaScript (soundex function from http://rosettacode.org/wiki/Soundex#JavaScript ) <html> <head><title>Soundex</title> </head> <body> <script> var soundex = function (s) { var a = s.toLowerCase().split('') f = a.shift(), r = '', codes = { a: '', e: '', i: '', o: '', u: '', b: 1, f: 1, p: 1, v: 1, c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2, d: 3, t: 3, l: 4, m: 5, n: 5, r: 6 }; r = f + a .map(function (v, i, a) { return codes }) .filter(function (v, i, a) { return ((i === 0) ? v !== codes : v !== a[i - 1]); }) .join(''); return (r + '000').slice(0, 4).toUpperCase(); }; //TEST ONE: HARD vs HEART wordOne= soundex("hard"); wordTwo=soundex("heart"); if(wordOne==wordTwo){ alert("close"); } else{alert("nope");} //TEST TWO: PAUL vs BALL //use substring because first sound p and b is different but the next three numbers match one=soundex("paul"); two=soundex("ball"); if(one.substring(1)==two.substring(1)){ alert("close"); } else{alert("nope");} //TEST THREE: PAUL vs CAR //NOT CLOSE a=soundex("paul"); b=soundex("car"); if(a.substring(1)==b.substring(1)){ alert("close"); } else{alert("NOPE");} </script> </body> </html>
... View more
11-13-2014
10:25 AM
|
0
|
0
|
2201
|
POST
|
You want a webmap that is visible only to users logged in to Active directory? If you have access to IIS you can just open your server manager, click on the site you want to lock down, select authentication and set to: Anonymous Auth - Disabled ASP.net impersonation - Enabled Basic auth - Disabled Forms Auth - Enabled Windows Auth - Enabled
... View more
11-03-2014
01:09 PM
|
0
|
0
|
346
|
POST
|
If you are doing it yourself, try the REST API - it will return JSON and allows you to select a geometry and a geometry type. Your URL should be http://YourArcServerDomainName/ArcGIS/rest/services/yourFeatureName/FeatureServer/0/query Hit that with a formatted AJAX request and get back the JSON rep of the results Looks like the ESRI-Leaflet plugin only runs where on the whole data set. My money is on it just hitting your rest endpoint anyway so do it yourself.
... View more
10-14-2014
09:25 AM
|
0
|
0
|
1116
|
Title | Kudos | Posted |
---|---|---|
1 | 09-18-2014 01:38 PM | |
1 | 09-17-2014 12:47 PM | |
1 | 09-08-2014 03:32 PM | |
1 | 11-17-2014 07:42 AM | |
1 | 12-01-2014 01:37 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|