|
POST
|
Hi I'm slowly refactoring my legacy app into AMD style. I have code to change the style of the navigation buttons function toggleButtonIcon(tool) { //only the tools in the toolbar are dijit togglebuttons so can iterate thru them
registry.byId.byClass("dijit.form.ToggleButton").forEach(function (togbtn) {
if (togbtn == tool) {
togbtn.attr("checked", true);
} else {
togbtn.attr("checked", false);
}
});
}
and am having difficulty working out the AMD alternative form ByClass, as it seems to have changed - dijit/registry — The Dojo Toolkit - Reference Guide Note that for backwards compatibility, the dijit.registry global variable (as opposed to the dijit/registry module) includes array iterator methods (forEach, filter, byClass, map, every, and some). However, AMD code should not expect these functions to be available in the Object returned from require([“dijit/registry”]). My ideal is that my code will need not much, if any, change for the v4 API when all the features I use are in it, so I don't really want to have anything that will break later. Any help gratefully received! Cheers ACM edit I have now got as far as function toggleButtonIcon(tool) {
var domNodes= query('.dijitToggleButton', this.domNode);
domNodes.forEach(function(domNode){
var widget= registry.getEnclosingWidget(domNode);
console.log(domNode)
console.log(tool)
if (domNode == tool.innerHTML) {
console.log("yay")
} else {
console.log("nay")
}
}) But the Dojo query is returning the node whilst I am getting the full object passed into the function. My brain is tired and I can't work out how to compare the two ? I'll investigate getting the id out of the node
... View more
02-18-2018
04:38 AM
|
0
|
12
|
3337
|
|
POST
|
ok - old thread and the Git example is long gone, and I've got everything "working" but I do get this error on "closing" the pane (really hiding it) TypeError: Cannot read property 'addNode' of undefined
at Object._dock (js.arcgis.com/3.23/dojox/layout/FloatingPane.js:10)
at js.arcgis.com/3.23/init.js:63
at Object.<anonymous> (js.arcgis.com/3.23/dojox/layout/FloatingPane.js:8)
at d.Animation.onEnd (js.arcgis.com/3.23/init.js:63)
at d.Animation._fire (js.arcgis.com/3.23/init.js:248)
at d.Animation._cycle (js.arcgis.com/3.23/init.js:251)
at Object.<anonymous> (js.arcgis.com/3.23/init.js:63)
at Object.c [as run] (js.arcgis.com/3.23/init.js:119)
at js.arcgis.com/3.23/init.js:63 But many thanks for the earlier post.
... View more
02-16-2018
09:54 AM
|
0
|
0
|
2201
|
|
POST
|
Yes - as I said - it didn't seem to like me having user credentials in the proxy config - luckilly I don't need them at the moment, taking them out made everything work
... View more
12-19-2017
01:26 AM
|
0
|
0
|
1537
|
|
POST
|
Edit #2 Sorted it (I think) it wasn't happy I had a user name and password in the config (these services don't need them) - I may still have an issue when I come to services that DO need them. Odd.
... View more
12-04-2017
01:42 AM
|
0
|
0
|
1537
|
|
POST
|
More info, changing the Proxy config from <serverUrl url="http://server name" To <serverUrl url="http://server name/arcgis/rest/services/LIVEinternal/aerials/MapServer" moves the error from a 403 to the Server Error in '/' Application. The request was aborted: Could not create SSL/TLS secure channel. erorr - which to me looks like something is missing in the way I am testing the site in VS
... View more
12-04-2017
01:36 AM
|
0
|
1
|
1537
|
|
POST
|
Hi We've moved on and we now are encouraged to use VS correctly, with Source Control and local testing before it goes anywhere near a server Alas, my knowledge of VS in the modern world is lacking. As when I try to browse my site from VS, it goes to a localhot:1234 addresses and the proxy just fails to work at all, I get "Unable to load /proxy/proxy.ashx?http://<server name>/arcgis/rest/services/LIVEinternal/aerials/MapServer? f=json&dpi=96&transparent=true&format=png8 status: 500" With this as more info when I try to go direct to the URL The request was aborted: Could not create SSL/TLS secure channel. I've tried various changes to the proxy config, but just can't find the magic combination. Currently it is <ProxyConfig allowedReferers="*"
mustMatch="true">
<serverUrls>
<serverUrl url="http://<server name>/arcgis/"
username="webmap"
password="password"
matchAll="true"/>
<serverUrl url="https://<server name>/arcgis/"
username="webmap"
password="password"
matchAll="true"/>
</serverUrls>
</ProxyConfig> I would ideally like to get shot of the proxy, but the print service fails in IE11 without it 😞 Testing the proxy page with http://localhost:62146/proxy/proxy.ashx?ping gives { "Proxy Version": "1.1.2", "Configuration File": "OK", "Log File": "Not Exist/Readable"} So I think that is OK. Changing the allowedRefeerers to http:\<servername> changes the error from a 500 to a 403 And the full error is {"error": {"code": 403,"message":"Proxy has not been set up for this URL. Make sure there is a serverUrl in the configuration file that matches: http://<server name>/arcgis/rest/services/BaseMapOSNonTiled/MapServer?f=json&dpi=96&transparent=true&format=png8 http://<server name>/arcgis/rest/services/BaseMapOSNonTiled/MapServer?f=json&dpi=96&transparent=true&format=png8"}} I also can't get my head around this is in the config url: Location of the ArcGIS Server service (or other URL) to proxy. Specify either the specific URL or the root (in which case you should set matchAll="false"). matchAll="true": When true all requests that begin with the specified URL are forwarded. Otherwise, the URL requested must match exactly. To me that is contradictory, the first bullet says you need matchAll to be false where you just have the root, the second bullet seems to contradict that" Confused! Cheers ACM
... View more
12-02-2017
03:20 AM
|
0
|
4
|
2426
|
|
POST
|
Similar with me. I am trying to avoid the proxy (more later) all works fine, apart from printing in IE11 when I get the "If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers." - even through I do push the site that I am making a request to, The reason why I'm switching proxy off, apart from performance, is that I just can't get my head around the config for testing, we now are using a proper version control in Visual Studio so I have to test using VS, and the "localhost" seems to fail, even when I change the config. Although I'm going to look at why that is later, if I can move away totally it would be great. Any ideas why just IE11 is having issues?
... View more
12-02-2017
02:28 AM
|
0
|
0
|
873
|
|
POST
|
Mark as the answer - many thank - I think I need a bit more tweaking in my next bit of code, but I hink the wait is there now. Cheers
... View more
11-27-2017
08:39 AM
|
0
|
0
|
1234
|
|
POST
|
I gave it a very quick go - a slight modification, not "dojo._base.lang.hitch" but "dojo.hitch" - that gets it "working" - it is giving me loads of proxy errors now - but I'll have to look at them a different day Many thanks
... View more
11-27-2017
08:05 AM
|
0
|
0
|
1234
|
|
POST
|
Many thanks - Embarrassingly, when I was searching for an answer, I found I'd already asked the same question in March! Anyway, I'll give that a go when I have time and get back. For now I put a awful hack in the part that calls this info not to fire off until the array length of LayerDescriptions equals the number of layers
... View more
11-27-2017
07:57 AM
|
0
|
1
|
1234
|
|
POST
|
OK - I've a site I wrote years back which did work, but now due to a data centre move I realise it onl;y worked becasue the requests were resolved quickly, on the "new" network my code needs attention for timing. I have this dojo.connect(dynamicMapServiceLayer, "onLoad", function () {
var content = "";
var i = 0
//return the layer descriptions and © text into arrays - we use this later for the info dialog to generate hyperlinks and © text
dojo.forEach(dynamicMapServiceLayer.layerInfos, function (layer) {
//console.debug(dynamicMapServiceLayer.layerInfos[layer.id])
var requestHandle = esri.request({
url: mapserviceCustom + "/" + layer.id + "?f=json",
handleAs: "json",
load: function (data) {
LayerAttach[layer.id] = data.hasAttachments;
LayerDescriptions[layer.id] = data.description;
//LayerCopyright[layer.id] = data.copyrightText;
console.debug(dynamicMapServiceLayer)
dynamicMapServiceLayer.layerInfos[layer.id].copyrightText = data.copyrightText;
},
}, { useProxy: true });
});
}); That runs during the init of my site and gets more info from the REST of the service regarding each layer, I use this to dynamically control the copyright notice on the map, as this varies per layer. I store this info in the layer description. I've not looked at this for a long time, but I know I need to do something to stop the rest of the code working until all this has run, as a later part of my init code will use the results - but my hack skills are exhausted. Most of the site is in legacy and most examples I have found are in AMD. So any help gratefully received. Cheers ACM
... View more
11-26-2017
09:23 AM
|
0
|
4
|
1376
|
|
POST
|
Odd - i tried that yesterday, but gave up when the results looked like "0x346......." rather than "POLYGON(1234,.....) But I saved the view and flung it at ArcMap and it worked. Thanks
... View more
05-17-2017
04:37 AM
|
0
|
0
|
1427
|
|
POST
|
I found this thread just after I posted a similar question here https://community.esri.com/message/687252-sql-view-to-sanitize-geometrycollections I'd appreciate any comments to help me with this nastiness.
... View more
05-16-2017
08:20 AM
|
1
|
1
|
3351
|
|
POST
|
Hi We've a third party spatial application that writes into native T-SQL tables. It is happy with records like this; GEOMETRYCOLLECTION (LINESTRING (315271.762 90124.145, 315271.812 90124.195), POLYGON ((315276.18 90120.38, 315275.05 90111.07, 315280.15 90110.42, 315279.36 90103.58, 315271.65 90104.25, 315267.35 90104.62, 315267.319 90104.625, 315267.681 90107.209, 315268.95 90117.12, 315272.94 90116.62, 315273.32 90118.96, 315270.73 90119.4, 315270.91 90120.92, 315271.36 90124.08, 315276.432 90123.633, 315276.18 90120.38))) Anyone who has only ever used Esri products will, like me, be twitching at this mixing up stuff in a single record. Anyone have any SQL views or procedures to sanitize these records into a format that sane GIS products can cope with? Cheers ACM
... View more
05-16-2017
08:09 AM
|
0
|
3
|
2156
|
|
POST
|
I thought as much - we think we'll warehouse the data in SQL and do the conversion there. We don't like messing around in Oracle. Thanks
... View more
05-09-2017
05:21 AM
|
0
|
0
|
867
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-28-2025 01:14 AM | |
| 1 | 12-01-2023 06:07 AM | |
| 2 | 11-29-2024 04:32 AM | |
| 1 | 05-28-2024 12:50 AM | |
| 1 | 03-16-2023 06:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|