|
POST
|
I wonder if the object you're creating is causing the problem. Normally I always use a Graphic because the API uses the graphic object to create the json for the request even when updating just attributes. Anytime you get a toJson or fromJson error it's almost always because an object or json is malformed somehow or is something other than the to/from function expected. Properly creating a Graphic seems like safest way to go and best practice. var feature = new Graphic();
feature.setAttributes({
OBJECTID: 1094,
Well_ID: 565656,
GWIC_ID: "efg789",
Geomethod_ID: 5,
Township: "1N",
Range: "1E",
Section_: "1",
Quarter_Section: "sw ne",
Physical_Address_WellName: "Baxter and Puckett",
Subdivision: "Test point 07",
City_ID: 4,
TotalDepth_ft_: "87"
});
... View more
10-29-2013
02:21 PM
|
0
|
0
|
5056
|
|
POST
|
Does it throw an error when you do nothing in the callback function?
... View more
10-29-2013
01:34 PM
|
0
|
0
|
5056
|
|
POST
|
The return on applyEdits is three objects not one. An error is thrown because of an error in the callback function not because the operation failed. layer.applyEdits([feature], null, null, function (add, update, del) {
array.forEach(add, function (a) {
console.log(a.status);
});
}, function (error) {
console.log(error);
});
layer.applyEdits(null, [feature], null, function (add, update, del) {
array.forEach(update, function (u) {
console.log(u.status);
});
}, function (error) {
console.log(error);
});
layer.applyEdits(null, null, [feature], function (add, update, del) {
array.forEach(del, function (d) {
console.log(d.status);
});
}, function (error) {
console.log(error);
});
... View more
10-29-2013
12:39 PM
|
0
|
0
|
5056
|
|
POST
|
Here: https://github.com/btfou/cutthroat-trout When you can; no rush. Thanks
... View more
10-25-2013
05:39 PM
|
0
|
0
|
1931
|
|
POST
|
Still haven't figured it out. This is where I'm at: Custom layer: require(['dojo/_base/declare', 'esri/layers/layer', 'esri/layers/TileInfo', 'esri/geometry/Extent'], function (declare, layer, TileInfo, Extent) {
var customLayer = declare('modules.CustomLayer', layer, {
declaredClass: 'modules.CustomLayer',
constructor: function (params) {
params = params || {};
this.tileInfo = new TileInfo( /*tile info*/ );
this.fullExtent = Extent( /*extent*/ );
this.initialExtent = Extent( /*extent*/ );
this.loaded = true;
this.onLoad(this);
}
//functions blah blah blah
});
return customLayer;
}); Using it: require(['dojo/_base/declare', 'esri/map', 'modules/CustomLayer', 'dojo/domReady!'], function (declare, Map, CustomLayer) {
var map = new Map('map-div', {
//map params
});
console.log(CustomLayer); //returns integer 3
console.log(modules.CustomLayer); //returns function()
map.addLayer(new CustomLayer()); //fail
map.addLayer(new modules.CustomLayer()); //works
}); I don't understand why I need to set the className argument to even access the module, and I don't understand why I can't use the variable, but instead have to call the class itself. I'm not having to set className with templated widgets or other classes.
... View more
10-25-2013
01:12 PM
|
0
|
0
|
1931
|
|
POST
|
You have dijit/registry loaded use registry.byId(). I doubt resizing the bc is causing the problem. Does it happen w/o resizing? What css is being loaded from css/layout.css? You could be causing problems if your original css is being used.
... View more
10-24-2013
02:32 PM
|
0
|
0
|
3096
|
|
POST
|
There's a couple issue with your layout. 1) Only html, body and the border container should be width:100%; height:100%;. 2) Use the center region as the map div. You don't need an extra div. The center region auto sizes itself. You can use any layout widget for a region. [HTML]<div id="borderContainer" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design: 'headline', gutters: true, liveSplitters:true"> <div id="header" data-dojo-props="region:'top'" data-dojo-type="dijit/layout/ContentPane"> <div id="title">Welcome</div> </div> <div id="mapDiv" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'"></div> <div id="leftPane"data-dojo-type="dijit/layout/TabContainer" data-dojo-props="splitter:true,region: 'left'"> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Tab 1'"> Tab One </div> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Tab 2'"> Tab Two </div> </div> </div>[/HTML] html, body {
width:100%;
height:100%;
}
#leftPane {
width:20%
}
#mapDiv {
padding:0;
overflow: hidden;
} 3) Always resize the border container last in your function. This is particularly important when adding widgets programmatically, like another tab in the tab container. It will ensure the layout is correct. dijit.byId('borderContainer').resize(); See if that doesn't make your problems cease.
... View more
10-24-2013
12:39 PM
|
0
|
0
|
3096
|
|
POST
|
Thanks John. I did start declaring and returning a variable. Still haven't worked it out. In this case, I'm creating a custom layer and I think there's an issue with how I'm declaring it. Not having that problem with other classes and widgets. I'm sure the solution will come to me sooner or later.
... View more
10-23-2013
03:01 PM
|
0
|
0
|
1931
|
|
POST
|
Thanks! This helped me out a lot with a project I am working on! You're welcome to the forum.
... View more
10-23-2013
02:43 PM
|
0
|
0
|
2824
|
|
POST
|
I have two modules in a folder called "mods", which is loaded as a package with dojoConfig. I require ModuleA in ModuleB, and it loads. But I can't use it as a variable of the define function, only by a legacy call (see code). If I require ModuleA in the application I can use it normally. Am I missing something? Any help is appreciated. ModuleA: define([ 'dojo/_base/declare' ], function (declare) { return declare('mods.ModuleA', [], { //create module }); }); ModuleB: define([ 'dojo/_base/declare', 'mods/ModuleA' ], function (declare, ModuleA) { return declare([], { //create module createA: function() { console.log(ModuleA); //returns an interger?!?! console.log(mods.ModuleA); //returns module function() /* this.container.addChild(new ModuleA({a: 1, b: 'hi'})); // throws an error because ModuleA = some integer */ this.container.addChild(new mods.ModuleA({a: 1, b: 'hi'})); //legacy works?!?! } }); });
... View more
10-21-2013
03:56 PM
|
0
|
9
|
2395
|
|
POST
|
Here's a thread where I discussed the basic concept. http://forums.arcgis.com/threads/89663-How-can-I-save-the-data-info-and-drawing-to-database-and-reopen-it-later
... View more
10-18-2013
09:40 AM
|
0
|
0
|
835
|
|
POST
|
Here's the basics. require([
//layout x
'dojox/layout/FloatingPane',
'dojox/layout/Dock',
//dojo
'dojo/dom-construct',
'dojo/_base/window',
], function (
//layout x
FloatingPane, Dock,
//dojo
domConstruct, win
) {
var dock = new Dock({
style: 'position:absolute;bottom:0;right:0;height:0px;width:0px display:none;z-index:0;'
}, domConstruct.create('div', null, win.body()));
//measure floating pane
var measurefp = new FloatingPane({
id: 'measure-floating-pane',
title: 'Measure',
resizable: false,
resizeAxis: null,
closable: false,
dockable: true,
dockTo: dock,
style: 'position:absolute;top:80px;left:320px;width:220px;height:200px;visibility:hidden;overflow:hidden;',
href: 'html/measure.html',
preventCache: true,
preload: false
}, domConstruct.create('div', null, win.body()));
measurefp.startup();
measurefp.on('focus', function () {
measurefp.bringToTop();
});
measurefp.on('show', function () {
measurefp.bringToTop();
});
}); The difference with AMD is you need to require dojox/layout/Dock to use it in the function as a variable. In legacy and AMD the dock is required by the floating pane class. You can still create a new dock with var dock = new dojox.layout.Dock() in AMD, but that kinda defeats the point.
... View more
10-18-2013
09:25 AM
|
1
|
0
|
1992
|
|
POST
|
Since migrating to AMD I occasionally get a TypeError: this.spatialReference is undefined on app load. It's quite random. Sometimes I can do a hundred page loads and not get it once; sometimes it occurs several times in a row; and at other times it's consistent once every 5-6 page loads. There's no additional info with the error. It doesn't break the app, and as far as I can tell it doesn't cause any other problems. Still I wonder what it is and if it's something I'm causing with load order?
... View more
10-16-2013
09:38 AM
|
0
|
1
|
742
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-18-2013 06:56 AM | |
| 1 | 06-30-2015 09:17 AM | |
| 1 | 10-12-2013 07:14 AM | |
| 1 | 02-05-2014 11:05 AM | |
| 1 | 05-28-2015 11:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|