|
POST
|
I have tried http and https in my proxyUrl, so that doesn't seem to make a difference. One of the threads I read made it sound like IdentityManager would generally resolve whatever paths it needed to follow. But it didn't seem to hard to add some refrences to serverInfo after my proxyUrl
esri.config.defaults.io.proxyUrl = "https://ogitest.oa.mo.gov/proxy/proxy.ashx";
var serverInfo = new esri.ServerInfo();
serverInfo.server = 'https://ogi.oa.mo.gov';
serverInfo.tokenServiceUrl = 'https://ogi.oa.mo.gov/arcgis/tokens/generateToken';
I wasn't sure if the ESRI base maps would all respond with https in the path. The other internal layer should also be available as both http and https because I have it all set up that way in the reverse proxy etc. What I am a little confused on is what needs to go in my proxy config file. Do I also need references to the token directory? The examples all show rest service directory paths, but wouldn't you need an entry for the token as well?
... View more
12-13-2012
09:37 AM
|
0
|
0
|
2299
|
|
POST
|
Has anyone been using IdentityManager successfully? It looks like it's calling the generate token using the server name, even though I have explicitly set my tokenServiceUrl. Is IdentifyManager just doing its own thing internally and ignoring this setting? Or have I somehow messed it up in my proxy config? Do I need to do something special with my proxy config in order to get this to work? A few other threads mention the reverse proxy, which we are also using. It's getting very confusing to have a conversation with the system staff, when we have two different things to configure, both called proxy!!!
... View more
12-13-2012
06:47 AM
|
0
|
0
|
2299
|
|
POST
|
I see I missed the folder my service was in, so my path was wrong. I can answer my own question that "yes, if your service is invalid, you don't get a login". It would be more user friendly to have some sort of error. Is there something special that has to be in my proxy configuration? I'm not getting an error "Unable to access the authentication service", but looking at Firebug it tells me I have an error in my proxy.ashx file.
... View more
12-12-2012
11:36 AM
|
0
|
0
|
2299
|
|
POST
|
I am working through a basic IdentifyManager example. I have modified the bare minimum, just enough to have my extent and my services. When I run/debug this, it doesn't display a login. Is that because it doesn't really think my service is secure? The older examples show the login in a contentpane, but I assume identitymanager is what is controlling the login that comes up? How does it know what to put as the prompt? Just from the name of the service you are trying to load? I am using ArcGIS Server 10.1 SP5 and the security has been enabled and configured. and the security has been enabled. I have assigned a userID password to my service. I can generate a token from the service directory, so I think the server is set up to generate a token. I believe my proxy pages are configured and working. I have my SSL in place on my server. These are all things that I've seen that must be in place for this to work. It doesn't have to be a featureservice does it? I haven't seen that that is a requirement so far. I am using a featureLayer instead. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>Persisting Identity Manager Info</title> <link rel="stylesheet" href="https://community.esri.com//serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="https://community.esri.com//serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" /> <style type="text/css"> html, body { height: 98%; width: 99%; margin:0; padding-top:4px; padding-left:4px; } #rightPanel{ width:140px; border:2px solid #617798; -webkit-border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-topright: 4px; -moz-border-radius-bottomright: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; } #mapCanvas{ border-top:2px solid #617798; border-bottom:2px solid #617798; border-left:2px solid #617798; -webkit-border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-topleft: 4px; -moz-border-radius-bottomleft: 4px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; padding:0px; } .templatePicker{ height:80%; } </style> <script>var dojoConfig = { parseOnLoad: true };</script> <script src="//serverapi.arcgisonline.com/jsapi/arcgis/3.2/"></script> <script type="text/javascript"> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.IdentityManager"); var map, cred = "esri_jsapi_id_manager_data"; // cookie/local storage name function init() { // store credentials/serverInfos before the page unloads dojo.addOnUnload(storeCredentials); // look for credentials in local storage loadCredentials(); esri.config.defaults.io.proxyUrl = "http://ogi.oa.mo.gov/proxy/proxy.ashx"; /* map = new esri.Map("mapCanvas",{ extent: new esri.geometry.Extent({"xmin":-12080521,"ymin":4472736,"xmax":-11829657,"ymax":4563023,"spatialReference":{"wkid":3857}}) }); */ var spatialReference = new esri.SpatialReference({ wkid: 102100 }); startExtent = new esri.geometry.Extent(-10723197, 4186914, -9829190, 4992866, spatialReference); map = new esri.Map("mapCanvas", { extent: startExtent }); dojo.connect(map, "onLoad", function() { dojo.connect(dijit.byId('mapCanvas'), 'resize', map,map.resize); }); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); map.addLayer(basemap); var countyLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://myserver.mo.gov/arcgis/rest/services/county_simple/MapServer"); map.addLayer(countyLayer); var serverLayer = new esri.layers.FeatureLayer("https://myserver.mo.gov/ArcGIS/rest/services/myservice/MapServer/1",{ mode:esri.layers.FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); map.addLayer(serverLayer); } function loadCredentials() { var idJson, idObject; if ( supports_local_storage() ) { // read from local storage idJson = window.localStorage.getItem(cred); } else { // read from a cookie idJson = dojo.cookie(cred); } if ( idJson && idJson != "null" && idJson.length > 4) { idObject = dojo.fromJson(idJson); esri.id.initialize(idObject); } else { console.log("didn't find anything to load :("); } } function storeCredentials() { // make sure there are some credentials to persist if ( esri.id.credentials.length === 0 ) { return; } // serialize the ID manager state to a string var idString = dojo.toJson(esri.id.toJson()); // store it client side if ( supports_local_storage() ) { // use local storage window.localStorage.setItem(cred, idString); // console.log("wrote to local storage"); } else { // use a cookie dojo.cookie(cred, idString, { expires: 1 }); // console.log("wrote a cookie :-/"); } } function supports_local_storage() { try { return "localStorage" in window && window["localStorage"] !== null; } catch( e ) { return false; } } dojo.ready(init); </script> </head> <body class="tundra"> <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="position:relative;width:100%;height:100%;"> <div id="mapCanvas" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'"> </div> <!--right content panel--> <div id="rightPanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'right'"> <p> This sample shows how to view a secure map service using token-based authentication. Use the following credentials to test the application:</br> User Name: <b>rick</b></br>Password: <b>rick@esri</b> </p> <div id="content" style="height:100%;"></div> </div> </div> </body> </html>
... View more
12-12-2012
11:04 AM
|
0
|
7
|
5472
|
|
POST
|
Not in either IE or Firefox, no. The page loadsfine, it just doesn't do anything for me. I found a more simplistic example from the 'clip and ship' sample, so I was able to accomplish what I wanted. For future reference it would be good to have a working copy of something with more tools and panes to it.
... View more
12-11-2012
06:02 AM
|
0
|
0
|
1276
|
|
POST
|
Now that I have unzipped and loaded this example, it isn't doing anything except load the main page. The tools do nothing. I'm not getting any errors.
... View more
12-10-2012
11:41 AM
|
0
|
0
|
2436
|
|
POST
|
Thanks for the example. Since I haven't been doing Javascript very long, I prefer antiquated. It's about my speed!
... View more
12-10-2012
11:04 AM
|
0
|
0
|
2436
|
|
POST
|
I'm interested in seeing this example, but when I clicked on the link, it said it wasn't found in the Gallery.
... View more
12-05-2012
05:20 AM
|
0
|
0
|
2436
|
|
POST
|
This turned out to be a syntax problem in how I was formatting the address. The original address was defined as var inputAddress = { "SingleLine" : dojo.byId("txtAddress").value }; When I was creating the new input address, I was neglecting the "SingleLine" : part of this, which was making it properly formatted. I also needed to take into account a fully entered address, complete with ZIP code that might be used in a single line address input. This is what I came up with and I think will satisfy my situation. I don't have 10.1 server installed, so anything based on that is not an option. function locate() { map.graphics.clear(); locator.outSpatialReference = map.spatialReference; var inputAddress = { "SingleLine" : dojo.byId("txtAddress").value }; // console.log(address.SingleLine); var checkMO = inputAddress.SingleLine.slice(-2).toUpperCase(); var isNotANumber = false; if (isNaN(checkMO)){ isNotANumber = true; } var options; if ( checkMO !== 'MO' && isNotANumber ) { // console.log("not MO"); var newInputAddress = {"SingleLine" : dojo.byId("txtAddress").value + ",MO"}; options = { address : newInputAddress, outFields : ["*"] }; locator.addressToLocations(newInputAddress); }else { // console.log(inputAddress.SingleLine + "has MO"); options = { address : inputAddress, outFields : ["*"] }; locator.addressToLocations(inputAddress); } }
... View more
12-05-2012
04:39 AM
|
0
|
0
|
1266
|
|
POST
|
I am using the single line World Locator. I like that it works for both either a full address (310 W High St, Jefferson City, MO 65101) or just a city name (Jefferson City, MO). Since I am working with data specific to Missouri, I've been asked to make this more user friendly and somehow programmatically manage adding MO at the end of a city name if the user doesn't specify. I didn't think this would be a problem. I have an inputText field, textAddress and I'm defining the input address as the value in it. var inputAddress = { "SingleLine" : dojo.byId("txtAddress").value }; In Firebug, it says inputAddress is [object Object], but I can examine the value of SingleLine and see what I entered. Next I check to see if inputAddress already has the Missouri prefix, MO, at the end of the string: var checkMO = inputAddress.SingleLine.slice(-2).toUpperCase(); if ( checkMO !== 'MO' ) { console.log("not MO"); inputAddress = inputAddress.SingleLine + ", MO"; console.log(inputAddress); }else { console.log(inputAddress.SingleLine + " has MO"); } Then I pass inputAddress to the locator: locator.outSpatialReference = map.spatialReference; var options = { address : inputAddress, outFields : ["*"] }; locator.addressToLocations(inputAddress); } This doesn't work. I think it is because inputAddress starts out as an object and I'm trying to deal with a string. I tried inputAddress + ", MO" instead of inputAddress.SingleLine + ", MO", but neither seems to work. Instead the locator says it found no matches. I can see that the inputAddress looks OK in the console window. Could someone explain what's wrong with my logic and/or provide a workaround to this?
... View more
12-03-2012
07:17 AM
|
0
|
4
|
1868
|
|
POST
|
I worked through the Park finder example myself. It didn't work for me until I had my proxy set up correctly.
... View more
11-29-2012
11:37 AM
|
0
|
0
|
1962
|
|
POST
|
You will find example throughout the forum of specific widget that people have "lifted" out of the Flex Viewer to be used within a basic FLEX API (non-Viewer). I recall the Legend Widget in particular has several threads about it. In general though, Flex Viewer is designed to work with itself. Users develop additional widgets for added functionality or modify existing widgets to have slightly different behavior. I would not consider myself either a "newbie" or an advanced developer, somewhere in the middle. Personally I found it difficult to copy enough of the widget code to work in my standalone FLEX API (none of my work is based on viewer). I would not say you are limited to a single map service if you are creating your applications from scratch. You do get that impression looking at the samples because they are all very plain.
... View more
11-28-2012
05:52 AM
|
0
|
0
|
781
|
|
POST
|
I think it works best if you use the feedback link that is at the top of each page of documentation. That way the exact page is submitted to ESRI.
... View more
11-28-2012
05:37 AM
|
0
|
0
|
405
|
|
POST
|
I've had better luck modifying the xmin,xmax of the initial extent. When using the ESRI tiled base maps, it's not exact; you're always going to be tied to whatever scale is the nearest to the extent you specify.
... View more
11-27-2012
09:07 AM
|
0
|
0
|
1676
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|