|
POST
|
I thought tabs shared sessions, so if a user was logged in via a session, it should persist across tabs. That's odd. You could try storing the credentials yourself. There is a sample up that shows how using cookies or localStorage. https://developers.arcgis.com/javascript/jssamples/widget_identitymanager_client_side.html That might help you manage it a little better.
... View more
06-17-2014
06:52 AM
|
0
|
0
|
902
|
|
POST
|
Well, I kind of found hacky workaround. Double-tap works, still testing other gestures like hold. // get the map id, coincides with DOM element id. var nodeId = this.map.id; // get the graphics container node, it looks like "map-id_gc" var node = dom.byId(nodeId+'_gc'); // listen for doubletap on the graphics container of svg graphics on(node, tap.doubletap, lang.hitch(this, function(e) { // I keep an array of layers to search through, but you could just // work off a single layer arrayUtils.forEach(layersArray, function(lyr) { var i = lyr.graphics.length; while(i--) { // get a graphic var graphic = lyr.graphics; // get the node of the graphic var gnode = graphic.getNode(); // if the node and the doubletap target are a match // do what you want to do if (gnode === e.target) { e.graphic = graphic; // I pass this on to my original double-click // handler and just add the graphic to the event // pretty much a duplicate of the dbl-click event this.onLayerDblClick(e); } } }, this); }) ); This is working so far, I'm just going to see if I can incorporate Modernizr tests to check for when I have to do this. https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js *edit - this does work for hold too, so I'm pretty happy with it. Although hold seems to have same issues discussed here http://forums.arcgis.com/threads/111887-Graphics-mouse-down-alert-boom. That work around doesn't seem to work with hold, so as long as I distinguish when to use which events based on touch events, everything works as expected.
... View more
06-05-2014
02:06 PM
|
1
|
1
|
3250
|
|
POST
|
You ever hear anything? This is holding me up on something too. Double-click or double-tap, whatever is used internally must work in the API, because I can use it to zoom in the map, just not on FeatureLayers.
... View more
06-05-2014
12:25 PM
|
0
|
0
|
3250
|
|
POST
|
Ha, thank you good sir. event.stopPropagation() did the trick! http://jsbin.com/pixima/3/
... View more
06-05-2014
10:16 AM
|
0
|
0
|
1793
|
|
POST
|
So I'm having some difficulty using the mouse-down event for layers. If I have have an alert popup on a mouse-down event, the map pan gets stuck. Here is a jsbin http://jsbin.com/pixima/1/ I've tried manually firing off click events or other mouse-up/down events, but I can't get the map unstuck. Has anyone come across this and more importantly, know how to fix it. Thanks.
... View more
06-05-2014
08:48 AM
|
0
|
4
|
2305
|
|
POST
|
This can work too if (graphic.geometry.type === 'point') {
var maxZoom = map.getMaxZoom();
map.centerAndZoom(graphic.geometry, maxZoom - 1);
} else {
map.setExtent(graphicsUtils.graphicsExtent([graphic]));
}
... View more
06-04-2014
01:59 PM
|
0
|
0
|
3168
|
|
POST
|
Are there any updates to this issue? Changing the compatibility mode isn't always an option on some embedded projects.
... View more
06-03-2014
10:06 AM
|
0
|
0
|
2157
|
|
POST
|
I've run into similar error handling situations with the arcgis utils createMap method. http://forums.arcgis.com/threads/111190-Some-more-useful-error-handling-for-broken-services-please. In your case though, you may try creating the layer first as a variable then adding it to the map. This will let you listen for errors on the layer. var layer1 = new esri.layers.ArcGISTiledMapServiceLayer(...);
var layer2 = new esri.layers.ArcGISTiledMapServiceLayer(...);
layer1.on('error', function() {/* handle errors */});
layer2.on('error', function() {/* handle errors */});
map.addLayers([layer1, layer2]); I haven't tested this, so this could still break the adding of all layers to the map if even one is bad, but you could at least rerun the map.addLayers again with only the valid layers if you needed to. I'm of the opinion that breaking map creation when 1 out of 2 or more layers added is invalid is a bug, but I haven't heard one way or another. For now, it just boils down to trying to capture and fix errors as they come along.
... View more
06-03-2014
09:07 AM
|
0
|
0
|
977
|
|
POST
|
So I ran into this problem with (version 3.9) esri/arcgis/utils#createMap where my defined basemap layer is down, so the map creation errors out completely and breaks my app.
arcgisUtils.createMap(webmapJSON, elementId, options).then(onSuccess, onError);
What I can do is use the error function to add a different basemapLayer url (like the Esri World Imagery), but there are a few issues here. Error seems to delete basemap object from basemapLayers array: This means I have to add a new object instead of just change the URL. It would be cool if you didn't mutate my objects. Error only tells me a URL is not valid: This could mean it's a basemapLayer or maybe an operationalLayer (map fails to create with a bad op layer URL too, checked), I'm not sure how to tell. This makes error handling these kind of things more difficult. Map creation doesn't need to be halted because of a bad URL: A map can exist without a basemap, maybe add the errors to the response callback to check for any errors that occured during the map creation process. In this case, I can tell after the fact that the basemapLayer is dead, but this doesn't help me in production to handle these errors if I can't tell what has gone wrong. The Error codes do contain an empty details array, so maybe the JS API internals could populate that with some more useful information. Although I like the idea of not breaking map creation because of a bad URL to begin with. It's much easier to handle a missing layer inside the application than it is to decipher what went wrong in the map creation process. *edit* - I just double-checked. The response object from the createMap promise does have an errors array. Can you just put any map creation errors there, including invalid URL errors? I suppose I'm confused why a broken basemap/operational URL will halt the map creation process.
... View more
05-29-2014
09:09 AM
|
2
|
1
|
1279
|
|
POST
|
There have been a couple of threads here discussing it. http://forums.arcgis.com/threads/92739-JS-API-Web-Application-with-Disconnected-Editing Also, there is an Esri project to allow disconnected editing up on github. https://github.com/Esri/offline-editor-js I just recently started trying to integrate the offline-editor into my most current project. The great thing about that library is that once you set it up, you can let it handle all the work of syncing the edits and not worry about it if you like. It even has a library that can ssupport TPK files.
... View more
05-27-2014
05:48 AM
|
0
|
0
|
2017
|
|
POST
|
So I have a few FeatureLayers in selection mode. They all share a common field, let's say "FEATURE_ID". One of the layers also has a field called "MAIN_FEATURE_ID". So I give a query like so.
var q = new Query();
q.where = "FEATURE_ID = '" + featureid +
"' OR MAIN_FEATURE_ID = '" + featureid + "'";
Now, I know that query is going to error out on 2 of my 3 FeatureLayers because only 1 has that second field. I don't care, that's what the error handler callbacks are for. So I do something like this for my FeatureLayers
var queries = arrayUtils.map(this.get('featureLayers'), function(lyr) {
return lyr.selectFeatures(q, FeatureLayer.SELECTION_NEW);
}, this);
Then I use dojo/promise/all to get all the data when everything is done.
all(queries).then(lang.hitch(this, function(results) {
var data = [];
data = data.concat.apply(data, results);
if (merged.length) {
this.get('map').setExtent(graphicsUtils.graphicsExtent(merged));
}
}), function(err) { // capture the errors here
console.debug('error', err);
});
What is happening here is that my error prints to console, but the API is throwing an internal error Error {code: 400, message: "Unable to complete operation.", details: Array[0], log: undefined, httpCode: 400???} init.js:187 This breaks something because not my success function doesn't get called either. If I check the network trace in Chrome dev tools, I can see the queries and responses, 2 of the requests return an error code of 400, but the last one returns valid results, but something is blocking that result from bubbling up to my success call. If I change the query to only search the one common field, everything is fine. Any clues? I tried adding my own Deferred and returning the Deferred#promise and capturing the error, thinking maybe there was a quirk in dojo/promise/all
var queries = arrayUtils.map(this.get('featureLayers'), function(lyr) {
var def = new Deferred();
lyr.selectFeatures(q, FeatureLayer.SELECTION_NEW).then(function(response) {
def.resolve(response);
}, function(err) {
console.debug('query error', err);
def.resolve([]);
});
return def.promise;
}, this);
Still no good. It looks like the errors the API throws are killing my success function. I know I'm going to get errors, I'll deal with it, but is this the intended behavior? Thanks.
... View more
05-23-2014
01:37 PM
|
0
|
0
|
859
|
|
POST
|
Just to test yesterday, I uploaded the zip fo the CSV Layer example (as-is) and just checked, it's still at status of "queued". Maybe that's a bad sample to test off, but it's fairly simple, so not sure what's holding it up. Developer Account and running around 24 hours now probably.
... View more
05-21-2014
02:54 PM
|
0
|
0
|
2940
|
|
POST
|
For just listening for events, no. Map extends dojo/Evented, so that allows you to do use it like map.on() to listen for events. It also allows you to use dojo/on to listen for events on the map. The added benefit of using dojo/on is it provides a little more utility, like pausable handlers. var handler = on.pausable(map, 'click', method);
handler.pause();
// some other stuff happens
handler.resume(); Or you could listen to events only once. on.once(map, 'load', method); So it all depends on what you are looking to do. I would recommend using the dojo/on method, simply for consistency as you will probably use it to listen for other events as well.
... View more
05-12-2014
01:20 PM
|
0
|
0
|
1047
|
|
POST
|
I've had some issues with the Geocoder as well. My observations in testing USA.PointAddress/USA.StreetAddress - Scores can very based on address, such as direction missing or not. These results seem to be acceptable. USA.StreetName - Score is only based on the Street name of address, number is ignored, scores are pretty useless here. For example, if the street name was a perfect match, score is 100, address number ignored. USA.Postal - Same as StreetName, if zip is a match, 100 score returned, Address number and Street name ignored. So I would actually check the Loc_name field to see what part of the composite locator provided the result and try to filter that way. Otherwise the scores will amost always be 100 and the Status will almost always be a Match, regardless if the address was actually found. I was actually thinking about posting this to the geocoder forum. I have a local composite locator we use in-house, but recently decided to use the Esri geocoder as a fallback for unmatched addresses and these issues came up. It has me rethinking of even using the Esri Geocoder in my apps because of the overhead of error checking. Technically, that Locator, such as the Postal would find a match at 100%, since that's what it's designed for, but it's up to you to filter out the locators. I am unsure if there is a way to tell the service to only use certain locators in a composite locator.
... View more
05-06-2014
02:01 PM
|
0
|
0
|
2546
|
|
POST
|
I've been using offline using PouchDB and the Application Cache. It's worked out really well for me, specifically for offline editing. The app HAS to connect to the internet at least once to grab th data and files, but after that it's good to go. I'm going to try and transition to this offline-editor in the esri github repo. https://github.com/Esri/offline-editor-js It looks real promising and they solved the issue I had with Application Cache where I couldn't refresh the browser in offline mode. They just updated the documentation as well, so it's much easier to understand.
... View more
05-01-2014
05:42 AM
|
0
|
0
|
1524
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|