POST
|
Hi, I would still expect onLayersAddResult to fire. According to the documentation, it should return an array with a status for each layer. the error object should be populated for a layer that errored: [INDENT]onLayersAddResult(results) Fires after all layers are added to the map using the map.addLayers method. (As of v2.0) Arguments: <Object[]> results Array of result objects with the following properties <Layer> layer Layer added to the map. <Boolean> success True if the layer was successfully added. <Error> error Error message if the map was unable to add the layer. [/INDENT] Bill
... View more
04-26-2013
11:39 PM
|
0
|
0
|
492
|
POST
|
By "offline", I mean the map service is valid but in a stopped state. I've found you can check for this by using the following. However, the map.onLayersAddResult still doesn't fire layer = new esri.layers.ArcGISDynamicMapServiceLayer(mapServiceInfo.URL);
dojo.connect(layer, 'onError', layer_onError);
....
function layer_onError(error) {
if (error) alert("Problem loading Layer\n" + "code = " + error.code + "\n" + error);
} Bill
... View more
04-26-2013
12:21 AM
|
0
|
0
|
492
|
POST
|
Hi I am adding multiple layers with addLayers(...) And checking to see when they have been added with onLayersAddResult(results) However, if any one of the map services is offline, the event never fires, even if all the other layers are OK Can anyone confirm if this is a Bug ? In addition, if you monitor onLayerAddResult(result) (in the singular) it never fires either for the offline service. The documentation implies that it should fire with an error object. Can anyone comment ? I am relying on onLayersAddResult(results) to initialize other stuff on my map Bill
... View more
04-25-2013
08:53 AM
|
0
|
9
|
960
|
POST
|
Yes, I'm still getting it. About 1 time in 10 or 20. I think its a timing issue with something. It doesn't help that the error is deep in the API There is no useful stack trace Regards, Bill
... View more
04-23-2013
12:37 AM
|
0
|
0
|
156
|
POST
|
In case anyone has a similar problem, I've found a workaround map.attribution.domNode.className = "esriAttribution esriAttributionOpen"; But it appears that you can't call this in the map.OnLoad() I've put it in map.onLayersAddResults() & it works Bill
... View more
04-15-2013
07:06 AM
|
0
|
0
|
213
|
POST
|
Can anyone help with this? Our customer is insisting that all copyrights appear when the map starts up Bill
... View more
04-15-2013
06:34 AM
|
0
|
0
|
213
|
POST
|
Does anyone know of a way of making the attribution dijit "open" by default. When you click on the widget it opens up. I'd like the map to start up with the dijit already open. I've tried forcing it open like like below, but nothing seems to work
var attribution = map.attribution;
// try & force the digit open - none of these work
attribution.declaredClass = "esriAttribution esriAttributionOpen";
attribution.domNode.className = "esriAttribution esriAttributionOpen";
attribution.domNode.click(); Any ideas ? Bill
... View more
04-01-2013
06:16 AM
|
0
|
2
|
626
|
POST
|
I could do with some advise on the same subject. Upgrading to 3.4 breaks my code, How do I either : a) set the default infoWindow back to infoWindow type or b) upgrade my code to support popupWindow ? I have a simple InfoWindow with html in it whereAmIgraphic.setInfoTemplate(new esri.InfoTemplate("Location : ", "<p>" + "<div id='divXYInfo'></div>" + ....
... View more
03-26-2013
02:44 AM
|
0
|
0
|
654
|
POST
|
Can anyone confirm that this is a problem is IE8? Seems to work OK in chrome & ff. Is there a fix ? thanks, Bill
... View more
03-22-2013
02:47 AM
|
0
|
0
|
259
|
POST
|
Hi, I'm getting an intermittent error on startup of my application. It occurs maybe 1 time in 10 The stack trace is all in anonymous code (i.e. not caused by my code) The stack trace in deep inside the 3.3 serverapi.arcgisonline.com code: [INDENT]'this.spatialReference' is null or not an object info=this.spatialReference._getInfo() _23c=this._getFrameWidth() this._setClipRect() this.onResize(ne,wd,ht) self._resize()[/INDENT] I have NO resize logic in my app. I have tried adding some in the style of earlier versions of the api , but this has made no difference. my app is quite large. Can anyone advise ? Bill // Makes no difference
function window_onResize() {
var resizeTimer;
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
if (map) {
map.resize();
map.reposition();
}
}, 500);
}
... View more
03-16-2013
12:33 AM
|
0
|
2
|
697
|
POST
|
Hi, I am having trouble with the geocoder widget not accepting <carriage return> in the search box. It seems to sometimes work in firefox, but not at all in IE. I have tried adding my own keystroke handler & then executing a geocoder.find() followed by a geocode.select(results) but this fails to fire the geocoder_onSelect() event. Can anyone advise is this is a bug or am I implementing something wrongly, Bill // create the geocoder
geocoder = new esri.dijit.Geocoder({
autoComplete: true,
showResults: true,
autoNavigate: true,
placeholder: "find thngs",
//arcgisGeocoder: false,
arcgisGeocoder: {
placeholder: "search...",
sourceCountry: "GB"
},
maxLocations: 10,
map: map,
theme: "simpleGeocoder", //"arcgisGeocoder"
geocoders: geocoders // use our own alongside esri default one
}, "divGeocodeSearch");
dojo.connect(geocoder, "onSelect", geocoder_onSelect);
dojo.connect(geocoder, "onFindResults", geocoder_onFindResults); // for manually capturing the results of a find
var inputbox = dojo.byId("divGeocodeSearch");
dojo.connect(inputbox, "onkeydown", geocoder_onKeyDown); // seems buggy about accepting <cr> so capture it myself
geocoder.startup();
}
function geocoder_onKeyDown(event) {
if (event.keyCode == dojo.keys.ENTER)
geocoder.find();
}
function geocoder_onFindResults(results) {
if (results.length > 0) geocoder.select(results[0]);
}
///////////////////////////
// FAILS TO FIRE ON <CR> (without the extra keystroke handler above)
// FAILS TO FIRE ON geocoder.select(results[0]);
function geocoder_onSelect(result) {
// DO STUFF WITH THE RESULT
}
... View more
03-16-2013
12:23 AM
|
0
|
3
|
626
|
POST
|
Erik, did you get anywhere with this ? I have exactly the same problem Regards, Bill
... View more
03-14-2013
09:20 AM
|
0
|
0
|
542
|
POST
|
Hi, I'm having trouble with the the basemapGallery OnSelectionChange event. It only seems to ever fire once (see attached code) am I missing something ? Bill [HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title> </title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" /> <style type="text/css"> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } .esriBasemapGallerySelectedNode .esriBasemapGalleryThumbnail{ border-color: #66FFFF !important; } #map{ padding:0; } </style> <script type="text/javascript"> var djConfig = { parseOnLoad: true }; </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2"></script> <script type="text/javascript"> dojo.require("dijit.dijit"); // optimize: load dijit layer dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("dijit.TitlePane"); dojo.require("esri.dijit.BasemapGallery"); dojo.require("esri.arcgis.utils"); var map = null; function init() { var initExtent = new esri.geometry.Extent({ "xmin": -514440, "ymin": 5385504, "xmax": 4847158, "ymax": 7640702, "spatialReference": { "wkid": 102100} }); map = new esri.Map("map", { extent: initExtent }); createBasemapGallery(); //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map, map.resize); } function createBasemapGallery() { var basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, map: map }, "basemapGallery"); var selectionHandler = dojo.connect(basemapGallery, "onSelectionChange", function () { dojo.disconnect(selectionHandler); //add the esri population layer to the map var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer", { "opacity": 0.5 }); alert("firing"); map.addLayer(operationalLayer); }); basemapGallery.startup(); dojo.connect(basemapGallery, "onError", function (msg) { console.log(msg) }); } //show map on load dojo.addOnLoad(init); </script> </head> <body class="claro"> <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width:100%;height:100%;margin:0;"> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;"> <div style="position:absolute; right:20px; top:10px; z-Index:999;"> <div dojoType="dijit.TitlePane" title="Switch Basemap" closable="false" open="false"> <div dojoType="dijit.layout.ContentPane" style="width:380px; height:280px; overflow:auto;"> <div id="basemapGallery" ></div></div> </div> </div> </div> </div> </body> </html>[/HTML]
... View more
12-25-2012
11:38 AM
|
0
|
3
|
766
|
POST
|
Hi, I am looking for a way of setting the Display Coordinates in Code. These can be found under "Display"/"Units" Tab. I want to disable the entire tab using the config manager & then set the coordinates in code instead (forcing each uer ontothe same units system) I'm struggling to find a a way to do it. Does any one know a way? Bill
... View more
02-14-2012
07:58 AM
|
0
|
0
|
449
|
Title | Kudos | Posted |
---|---|---|
1 | 09-24-2019 10:28 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|