|
POST
|
I need to explicitly set my lods to control the max and min for my map. I'd like to have these stored in a separate file like lods.js and then just reference it. I'm not sure of the syntax for the file and I'm not sure how to reference it.
... View more
08-21-2015
08:45 AM
|
0
|
3
|
3774
|
|
POST
|
That can't be right. That's the order from the dojotoolkit documentation. I have various other content panes all with data-dojo-type and they work.
... View more
08-20-2015
01:45 PM
|
0
|
1
|
2688
|
|
POST
|
That's the exact opposite of what I had to do last time to get it to work, since apparently a dijit/form/Button isn't a widget, it's still acts like a dom element. When I initialized this thread, I wasn't able to find the button using 'registry.byId', and I had to switch it to dom.byId in order for it to be found. I can't believe I'm tripping over a button. I'm tempted to just leave like a plain old HTML button and just style it to look like the dojo theme.
... View more
08-20-2015
01:22 PM
|
0
|
0
|
401
|
|
POST
|
I hate to reopen a closed thread, but I'm having the same issue as before, but this time it's still not finding it. This is how my button is defined: <button id="btnMap" data-dojo-type="dijit/form/Button"> View Map </button> This is the click event I'm trying to add: var btnMap = dom.byId('btnMap');
on(btnMap, "click", function (evt){
console.log("button has been clicked")
window.open(pathName+"/DHSS/WICprovider/index.html");
}); It works if I don't have the data-dojo-type defined, but I want the styling that comes with it.
... View more
08-20-2015
12:46 PM
|
0
|
4
|
2688
|
|
POST
|
I don't think I changed anything, but suddenly it decided to work! I had several break points set. Once I took them out, it was fine. Usually it's the break points that pause the script long enough to let it finish executing.
... View more
08-20-2015
12:05 PM
|
0
|
0
|
1106
|
|
POST
|
I don't think I'm calling it correctly either. Fixing myIdentify.js, I'm still getting Cannot read properly 'then' of undefined on the line var name = myIdentify.runIdentify().then(lang.hitch(this,function(response){
... View more
08-20-2015
11:17 AM
|
0
|
0
|
1106
|
|
POST
|
I want to be able to use the point of an address as the input geometry to my IdentifyTask. I'm having a scope problem. I can see that my identify task is finding the county, but I'm not calling/returning that name properly. I'm sure I'm not using lang.hitch properly, but I can tell that select-result was completing before runIdentify ever started. searchTool is my Search widget. on(searchTool,'select-result', function (evt){
var addr = evt.result.name;
app.addrExt = evt.result.extent;
myIdentify.runIdentify().then(lang.hitch(this,function(response){
runQueries(app.countyName);
})
)
}) myIdentify.js define ([ "dojo/on", "esri/tasks/IdentifyTask","esri/tasks/IdentifyParameters",
"esri/geometry/Point","esri/geometry/Extent","esri/geometry/webMercatorUtils"
], function ( on,IdentifyTask,IdentifyParameters,Point,Extent,webMercatorUtils
) {
return {
initIdentify: function(url){
app.idTask = new IdentifyTask(url);
app.idParams = new IdentifyParameters();
},
runIdentify: function(){
var webPt = webMercatorUtils.lngLatToXY(app.addrExt.xmin, app.addrExt.ymin);
var point = new Point(webPt[0], webPt[1], app.spatialReference);
app.idParams.geometry = point;
var pxWidth = app.map.extent.getWidth() / app.map.width;
var padding = 3 * pxWidth;
var qGeom = new Extent({
"xmin": point.x - padding,
"ymin": point.y - padding,
"xmax": point.x + padding,
"ymax": point.y + padding,
"spatialReference": app.spatialReference
});
app.idParams.geometry = point;
app.idParams.mapExtent = qGeom;
app.idParams.tolerance = 1;
app.idParams.returnGeometry = true;
app.idTask.execute(app.idParams).then(function(results){
app.countyName = results[0].value; // the identify is finding the county name here, I'm just not returning it properly
});
return app.countyName;
}
}
});
... View more
08-20-2015
09:02 AM
|
0
|
3
|
3694
|
|
POST
|
Well, yes and no. I found a workaround, but I decided I really didn't like the behavior I was getting. When the sidebar resized triggered a map resize, it almost looked like the map was jumping around, especially if the amount it needed to resize wasn't much. I called this when I populated the grids that were making the sidebar expand. function resizeMap() { var mapCon = dom.byId('map-row'); if (app.sidebar.offsetHeight && app.map) { domStyle.set(dom.byId('map'), 'height', app.sidebar.offsetHeight + 'px'); app.map.resize(); } } The other thing I didn't like was the map center was also repositioned, because the overall map div was larger. Sometimes it adjusted enough the area you were looking at 1/2 disappeared, forcing you to scroll on your map back to the area you'd been looking at.
... View more
08-14-2015
11:09 AM
|
0
|
0
|
2537
|
|
POST
|
No, I don't think so. The functionality is particular to that one grid.
... View more
08-12-2015
09:41 AM
|
0
|
0
|
1617
|
|
POST
|
I changed the location/syntax of executeSpecialtySearch: function(specCode){ to be within createSpecialtyList as return { createSpecialtyList: function(catCode, dataGrid, crossRefTable){ var specType = ""; var data; var query = new Query(); var whereClause = "ID_CATEGORY_TYPE_FK" + " = '" + catCode + "'"; if (domClass.contains('specialtyDiv', 'div-visible')) { domClass.toggle('specialtyDiv', 'div-visible'); } query.where = whereClause; .... function executeSpecialtySearch(specCode){ ..... } }, emptySpecDropdown: function(){ ..... It was a scope problem, I just needed to study it a bit more.
... View more
08-12-2015
08:39 AM
|
0
|
1
|
1617
|
|
POST
|
Well that piece of it anyway. I've been hesitant to show my ignorance of how to write proper AMD style, but I decided I wasn't the only one who is confused. I feel like all the examples are either 'hello world' level or broken into so many bits that I lose track of how it all fits together. There's not nearly enough transitional type examples to suit me.
... View more
08-11-2015
09:48 AM
|
0
|
0
|
1803
|
|
POST
|
I have a grid that needs a click event. The grid populates fine, but the click event isn't hooked up correctly. I thought I could reference other functions in my modules, but instead it tells me it isn't defined. I know sometimes if the function you're calling has a problem, it will act like the function isn't there, but I tried commenting out everything but a single line that made a console.log call and it still says "Uncaught ReferenceError: executeSpecialtySearch is not defined. define([
"dojo/dom",
"dojo/on",
"dojo/dom-class",
"dojo/dom-construct",
"dojo/_base/array",
"dojo/store/Memory",
"esri/tasks/QueryTask",
"esri/tasks/query",
"extras/codeLookup"
], function(
dom, on, domClass, domConstruct, arrayUtils, Memory, QueryTask, Query, codeLookup){
return {
createSpecialtyList: function(catCode, dataGrid, crossRefTable){
if (domClass.contains('specialtyDiv', 'div-visible')) {
domClass.toggle('specialtyDiv', 'div-visible');
}
var data;
var query = new Query();
var whereClause = "ID_CATEGORY_TYPE_FK" + " = '" + catCode + "'";
query.where = whereClause;
query.outFields = ['ID_SPECIALTY_FK'];
query.returnDistinctValues = true;
var qTask = new QueryTask(crossRefTable.url);
qTask.execute(query, function(results){
var data = arrayUtils.map(results.features, function(feature){
return {
'id': feature.attributes.ID_SPECIALTY_FK,
'name': codeLookup.findSpecDesc(feature.attributes.ID_SPECIALTY_FK),
'value': feature.attributes.ID_SPECIALTY_FK
};
});
var currentMemory = new Memory({
data: data,
idProperty: 'id'
});
var specDropdown = new dataGrid({
selectionMode: 'single',
store: currentMemory,
showHeader: false,
cellNavigation: false,
columns: {
"id": "id",
"name": "name",
"value": "value"
},
renderRow: function(obj){
var divNode = domConstruct.create('div', {
className: obj.name
});
domConstruct.place(document.createTextNode(obj.name), divNode);
return divNode;
}
}, "specialtyDiv");
specDropdown.on('.dgrid-row:click', function(event){
row = specDropdown.row(event);
var specCode = [row.data.value][0];
var specDesc = [row.data.name][0];
specType = specDesc;
// console.log("Searching: " + catDesc + ", cat Code: " + catCode);
executeSpecialtySearch(specCode); //fails here
});
specDropdown.addKeyHandler(13, function(event){ //added for Keyboard event
row = specDropdown.row(event);
var specCode = [row.data.value][0];
var specDesc = [row.data.name][0];
specType = specDesc;
// console.log("Searching: " + catDesc + ", cat Code: " + catCode);
executeSpecialtySearch(specCode);
});
specDropdown.startup();
specDropdown.sort('name');
});
return data;
},
emptySpecDropdown: function(){
specType = "";
domConstruct.empty(dom.byId('specialtyDiv'));
domClass.toggle('specialtyDiv', 'div-visible');
dom.byId('specHeader').innerHTML = "";
if (domClass.contains('specialtyDiv', 'dgrid')) {
domClass.remove(dom.byId('specialtyDiv'), "dgrid dgrid-grid");
}
},
executeSpecialtySearch: function(specCode){
var query = new Query();
var initWhereClause = app.featureLayer.getDefinitionExpression();
var appendSpecClause = "ID_SPECIALTY_FK" + " = '" + specCode + "'";
var newWhereClause = "(" + appendSpecClause + ") AND (" + initWhereClause + ")";
app.featureLayer.setDefinitionExpression(newWhereClause);
var txt = searchType + "; " + specType;
dom.byId('subHeader').innerHTML = "Medicaid Provider Search: " + txt;
dom.byId('gridHeader').innerHTML = txt + " providers available in this area."
}
}
}); I'm confused when I should separate the functions with this syntax: functionName: function (myParam) { }, myOtherFunction : function (myotherParam){ } and when I should leave it more like myinitFunction: function (myParam) { myNestedFunction(myParam) { } } It seems like the first style is what you'd use if you were wanted to group a few sets of functions together and called externally and the other when the functions are more internal.
... View more
08-11-2015
09:43 AM
|
0
|
4
|
4020
|
|
POST
|
I defined it in my index.html as window.app = {} and now I can just reference my two code lists as app.codeList1 and app.codeList2 in my other modules.
... View more
08-11-2015
08:59 AM
|
1
|
1
|
1803
|
|
POST
|
I supposed the lines connecting the posts are supposed to help us, but they really don't. And you're right, two different Robert's doesn't help alleviate the confusion. I'm not finding that app is available to the rest of my modules. It seems like sometimes I see app = {}; and other times app = []; I'm defining it with curly braces. It seems like it should be a generic object, not an array. When I attempt to use it in another module that needs the codeList I just saved as app.specCodeList, it says it 'app' is not defined.
... View more
08-11-2015
08:46 AM
|
0
|
3
|
1803
|
|
POST
|
It doesn't anymore. My comment about them being the same is a reply to Robert's post. I can never decide whether I should Reply to an individual post or 'Reply to original post'. It completely changes the order the threads are listed. Your version works. This is an exercise for me in how to think in terms of modules. I have a working project, just all in one big file. I'm reviewing one section of code at a time, trying to determine what logically should go into its own module.
... View more
08-11-2015
08:31 AM
|
0
|
5
|
2349
|
| 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
|