|
POST
|
Try: function updateLayerVisibility (arg1, arg2) {
// only need to use require when updateLayerVisibility depends on module1, module2,...
require([module1, module2,...], function (module1, module2, ...) {
// code for updateLayerVisibility
});
} AMD encourages to define modules to wrap the functionalities. It's kind of awkward to define the functions in the legacy way, and trying to make use of AMD to load the dependencies asynchronously.
... View more
09-04-2013
12:14 PM
|
0
|
0
|
2256
|
|
POST
|
The issue happens when dojo is parsing the dom elements. One option is to create a white-background outerDIV that sits on top of the page. It only shows while loading so to cover all other dom elements, and hides after page loads. #outerDIV {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
background-color: white;
z-index: 1000;
} JS code to hide it once the page is parsed: dojo.style(dojo.byId("outerDIV"), "display", "none");
... View more
09-04-2013
11:44 AM
|
0
|
0
|
709
|
|
POST
|
Try this. The code just presents an idea, and assumes you are using the non-AMD style. Otherwise, change it accordingly. var geoms = dojo.array(graphics, function(aGraphic) { return aGraphic.geometry; });
geomService.project(geoms, function(geometries) {
onProjectCompleteHandler(geometries, graphics);
});
function onProjectCompleteHandler(geometries, graphics) {
dojo.array(graphics, function(aGraphic, idx) {
aGraphic.setGeometry(geometries[idx]);
});
// graphics should contain the projected geometries, and their attributes.
}
... View more
09-04-2013
06:02 AM
|
0
|
0
|
332
|
|
POST
|
Assuming strAveryParam is a string array, strAveryParam = dojo.filter(strAveryParam, function(aAveryLabel) { return !!aAveryLabel; }); If strAveryParam is an object array that contains a property "label" that will be used for the filter. strAveryParam = dojo.filter(strAveryParam, function(oAvery) { return !!oAvery.label; });
... View more
09-03-2013
05:03 PM
|
0
|
0
|
357
|
|
POST
|
Luci, it makes perfect sense to add more basemaps to the BasemapGallery. But in jsn's case, he wants to switch to different maps which, if I understand correctly, contains any number of map layers that can be tiled or dynamic map layers. Just like each map view is a map document. If so, then customize the basemap gallery would be conceptually awkward.
... View more
09-03-2013
11:07 AM
|
0
|
0
|
857
|
|
POST
|
var layerinfo = baseLayer.layerInfos; // map.layerIds var layer = layerinfo[4]; layer.queryRelatedFeatures(relatedQuery, function(relatedRecords) { layerInfo cannot be used to query related records. Two options: Use QueryTask.executeRelationshipQuery(parameters,callback?,errback?) Create a feature layer for layerinfo[4], and then queryRelatedFeatures(relQuery,callback?,errback?). Sample.
... View more
09-03-2013
09:49 AM
|
0
|
0
|
861
|
|
POST
|
I would not try to customize the BasemapGallery to meet your need. Actually, BasemapGallery is a very simple widget, a TitlePane with a ContentPane that hosts a list of base maps. You can borrow the same idea to develop a custom map view dijit. Create a TitlePane instance. Create a ContentPane instance that sits inside the TitlePane. Add your maps to the content pane. Define onClick event handler for each map view item that the map will switch to.
... View more
09-03-2013
09:33 AM
|
0
|
0
|
857
|
|
POST
|
One possibility I can think of is that your SDE geodatabase hasn't been registered with ArcGIS Server. So ArcGIS Server just copies the data to a file geodatabase on the server, which makes the field name like that. If so, register your SDE geodatabase, and republish the map service.
... View more
09-03-2013
06:35 AM
|
0
|
0
|
840
|
|
POST
|
Make sure the spatial reference you set in newExtent is the same as the one in selectedWell. If not, change it to be the same. The reason your zoom function messed up is due to the mismatch of the extent (x,y) values and the spatial reference.
... View more
08-30-2013
03:09 PM
|
0
|
0
|
619
|
|
POST
|
Now I see your code. But I have no idea which feature layer you like to click to get the service area. Tell me what you like to accomplish for the app, and I will see what I can make the code work. By the way, it requires a login to access your map services.
... View more
08-30-2013
10:17 AM
|
0
|
0
|
807
|
|
POST
|
You are using ESRI basemap, right? If so, all esri map services use web mercator spatial reference. Change: var newExtent = new esri.geometry.Extent({
"xmin": selectedWell.x - distance,
"ymin": selectedWell.y - distance,
"xmax": selectedWell.x + distance,
"ymax": selectedWell.y + distance,
"spatialReference": {
"wkid": 4326
}
}); To: var newExtent = new esri.geometry.Extent({
"xmin": selectedWell.x - distance,
"ymin": selectedWell.y - distance,
"xmax": selectedWell.x + distance,
"ymax": selectedWell.y + distance,
"spatialReference": {
"wkid": 102100
}
});
... View more
08-30-2013
09:56 AM
|
0
|
0
|
1727
|
|
POST
|
In my previous post, I assume all the map.graphics.graphics are points and clickedWell contains the feature attributes. If my assumption is not your case, you will need to modify it accordingly. What I would recommend is to create a graphics layer for each specific purpose instead of using the general map.graphics, so you have control on what graphics type you will add to each graphics layer. Specific to your question, what is the value of selectedWell after the forEach loop? If undefined, then no matching graphic found.
... View more
08-30-2013
09:15 AM
|
0
|
0
|
1727
|
|
POST
|
You have to call resize method of the borderContainer object when any of the child elements resized. Add the below line to the end of the function. dijit.byId("borderContainerID").resize();
... View more
08-30-2013
09:05 AM
|
1
|
0
|
1533
|
|
POST
|
function zoomRow(id) {
var grid = dijit.byId('grid');
var clickedWell = grid.getItem(id);
var selectedWell;
var distance = 500;
dojo.forEach(map.graphics.graphics, function (graphic) {
if ((graphic.attributes) && graphic.attributes.FID === clickedWell.FID) {
selectedWell = graphic.geometry;
return;
}
});
var newExtent = new esri.geometry.Extent({
"xmin": selectedWell.x - distance,
"ymin": selectedWell.y - distance,
"xmax": selectedWell.x + distance,
"ymax": selectedWell.y + distance,
"spatialReference": {
"wkid": 4326
}
});
map.setExtent(taxLotExtent);
console.log(map.graphics.graphics);
}
... View more
08-30-2013
08:51 AM
|
0
|
0
|
1727
|
|
POST
|
I think your code is working. Your map first loads the world street map service as the basemap, then you load the feature layer which sits on top of the basemap. I guess the feature layer is a polygon layer, and colored by countries so that the feature layer covers the basemap. Does that make sense?
... View more
08-30-2013
08:08 AM
|
0
|
0
|
440
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-17-2013 05:16 AM | |
| 1 | 11-06-2013 04:34 AM | |
| 1 | 08-29-2013 10:58 AM | |
| 6 | 10-20-2020 02:09 PM | |
| 1 | 11-20-2013 06:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-17-2024
08:41 AM
|