|
POST
|
contentPane/tabContainer declared in html markup. The 3rd tab holds a dataGrid, which is hidden by default. After findTask.execute, the dataStore is set and grid is filled, but I can't get it to display. here's a jsfiddle: http://jsfiddle.net/dbecker88/BhNEa/2/ At the bottom of the html markup, if you remove the <div id="searchStatus"></div> and re-run the fiddle, the datagrid displays fine. Any help with this? I would like to keep the searchStatus div because it gets loaded with various info during the find. Thanks!
... View more
08-17-2012
05:43 AM
|
0
|
1
|
950
|
|
POST
|
works great on .js file with Aptana studio 3; Thanks Kelly
... View more
08-15-2012
04:40 AM
|
0
|
0
|
3901
|
|
POST
|
currently have the following relationships: points ...| [point_to_mainTable] one point - many mainTable ...mainTable .........| [mainTable_to_subTable] one mainTable - many subTable .........subTable user clicks point and the 2 queryRelatedFeatures methods are ran, one for each related table. The records are post-processed and displayed in popup; all is well. How would I allow a user to search subTable or mainTable, in order to locate points? I could use a find task on the mainTable, grab matching records and graphic highlight joined points, but the subTable is trickier since it isn't immediately joined to points. any advice? thanks!
... View more
08-14-2012
11:25 AM
|
0
|
0
|
584
|
|
POST
|
currently running Desktop, Server, ArcSDE 10.0 planning to upgrade all to 10.1 I plan on uninstalling all 10.0 desktop and server instances, then install desktop and server 10.1. What about our SQL server express 2008 / ArcSDE 10.0 ? Do I uninstall SDE 10.0, then run the server install CD and select the SQL server 2008 option, enable gdb storage? After completing the wizard, I will have SDE 10.1? thanks
... View more
08-14-2012
09:41 AM
|
0
|
4
|
3124
|
|
POST
|
I am trying to modify the gallery sample - Public Information Map - 2.0. I want to include a dynamic map layer in the layers.js that will always be the active layer for map click events to display attributes in an info window but not appear in the Layers Menu for turning its display on and off. (It will be totally transparent and I do not want the user to even know the layer exists.) I have figured out the transparency and active for click event part but not how to remove it from the drop down Layers Menu. I would appreciate any help to this struggling beginner. I also modified this template, and in the end, it was a huge pain, and I almost ended up redeveloping the entire app. If you look, there's probably a function that adds all layer variables to an array, then later, another function loops over the array adding each layer to the legend widget. Just stop the layer in question from being added to the array and your done.
... View more
08-03-2012
05:48 AM
|
0
|
0
|
984
|
|
POST
|
from the api reference: "The name of the layer as defined in the map service."
a ->
...
id: "graphicsLayer4"
console.log(featureLayer.name) - would return the name of the layer as defined in the service. Doesn't look like you can define name, only properties listed in the 'constructor detail' section of the api reference.
... View more
08-03-2012
05:44 AM
|
0
|
0
|
1729
|
|
POST
|
found the problem. I ended up setting up a query task onLoad that fills a graphicsLayer will transparent points. I know this is duplicate data since the feature layer is already loaded/displayed on the map. However, the onMouseOver is hooked to the graphicsLayer and the onClick is hooked to the feat. layer; for me, this allows for easy switching b/t the two. Identify button enabled remove graphicsLayer disconnect graphicsLayer onMouseOver connect map onClick Identify button disabled loop over TOC and check if the layer is visible add graphicsLayer connect graphicsLayer onMouseOver disconnect map onClick
... View more
08-02-2012
06:15 AM
|
0
|
0
|
1094
|
|
POST
|
I attempted this but to no avail....and ideas? <button data-dojo-type="dijit.form.Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POLYLINE);map.hideZoomSlider();dojo.disconnect(handler);}">Polyline</button> I'd put the function up in the js and remove it from your html markup. i'm doing something very similar, disabling onClick listener, enabling onMouseOver listener when load, then the opposite when identify button is clicked. search for my thread "onMouseOver onMouseOut" and you can see my markup. something like this //globals var handler; //var to hold event listener var map; var toolbar; function init(){ //define map here //define toolbar here handler = dojo.connect(map,"onClick",executeIdentifyTask); } function initToolbar(){ dojo.disconnect(handler); toolbar.activate(esri.toolbars.Draw.POLYLINE); map.hideZoomSlider(); } dojo.addonload(init); <button data-dojo-type="dijit.form.Button" data-dojo-props="onClick:initToolbar()">Polyline</button>
... View more
07-30-2012
03:27 PM
|
0
|
0
|
1492
|
|
POST
|
i'm almost there... when the map loads, the onMouseOver listener is active. Simple popups are displayed, highlightgraphic added. OnMouseOut also works removing the highlightgraphic. When the identify toggle button is clicked, onMouseOver is no longer active and executeIdentifyTask fires... so far so good. However, if you try and click a point that was previously hovered on, executeIdentifyTask is not fired, but rather, only the simple popup is displayed?? any advice? TIA!
//globals
var featlayer;
var identifyListener;
var facilsHoverHandle;
var facilsHoverHandleOut;
function init() {
featlayer = new esri.layers.FeatureLayer("url",{
mode:esri.layers.FeatureLayer.MODE_ONDEMAND,
id: 'facs',
outFields:["*"]
});
facilsHoverHandle = dojo.connect(featlayer, "onMouseOver", showHoverPopup);
facilsHoverHandleOut = dojo.connect(featlayer, "onMouseOut", hideHoverPopup);
}
function showHoverPopup(evt){
map.graphics.enableMouseEvents();
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setTitle(evt.graphic.attributes.facil_name);
infoTemplate.setContent("<b>${facil_name}</b>");
map.infoWindow.resize(245,125);
var highlightSym = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([255,0,0]), 1),
new dojo.Color([0,255,0,0.25]));
evt.graphic.setInfoTemplate(infoTemplate);
var content = evt.graphic.getContent();
map.infoWindow.setContent(content);
var title = evt.graphic.getTitle();
map.infoWindow.setTitle(title);
highlightGraphic = new esri.Graphic(evt.graphic.geometry,highlightSym);
map.graphics.add(highlightGraphic);
map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));
}
function hideHoverPopup(evt){
map.graphics.remove(highlightGraphic);
}
//toggles identify onClick and featlayer onMouseOver listeners on/off
function activateIdentify(){
if (dijit.byId("tool_identify").checked) {
map.infoWindow.hide();
dojo.disconnect(featlayerHoverHandle);
dojo.disconnect(featlayerHoverHandleOut);
identifyListener = dojo.connect(map, "onClick", executeIdentifyTask);
} else {
dojo.disconnect(identifyListener);
facilsHoverHandle = dojo.connect(featlayer , "onMouseOver", showHoverPopup);
facilsHoverHandleOut = dojo.connect(featlayer , "onMouseOut", hideHoverPopup);
}
}
<button dojotype="dijit.form.ToggleButton" id="tool_identify" title="Identify"
onclick="activateIdentify();" style="cursor:crosshair;">
<img src="images/infoIcon.png" width="34px" height="34px" alt="" />
</button>
... View more
07-30-2012
10:30 AM
|
0
|
0
|
1094
|
|
POST
|
i guess the short answer to why do i need identifyTask is because I saw this method in the samples. Now that I look back, the identifyTask seems to only be necessary if it's a dynamicLayer? There are multiple points atop each other at full scale, and when zoomed in, multiple layers can be selected, so I stuck with the deferred = identifyTask.execute() deferred.addCallback() then switch for each featureLayer name and set infoWindow accordingly. There are also several queryRelatedFeatures tasks for some of the layers. Do you have a sample of an identify tool, I've never seen one? Do you just use a dijit.form.button? thanks!
... View more
07-19-2012
03:39 PM
|
0
|
0
|
1094
|
|
POST
|
feature layer is added to map. I would like to hover and get basic info, then click and execute onClick identify task. the hover works great, the popup is displayed and the graphic is cleared onMouseOut, but as soon as the onClick is fired, it immmediately gets replaced by the basic onMouseOver popup. Im assuming this is becasue my hand isn't steady, onMouseOver -- basic popup, onClick --detailed popup, slight movement onMouseOver --basic popup. any help? function init() {
featlayer = new esri.layers.FeatureLayer("url",{
mode:esri.layers.FeatureLayer.MODE_ONDEMAND,
//infoTemplate:template,
id: 'facs',
outFields:["*"]
});
dojo.connect(featlayer, "onMouseOver", showHoverPopup);
dojo.connect(featlayer, "onMouseOut", hideHoverPopup);
dojo.connect(map,"onClick",executeIdentifyTask);
}
function showHoverPopup(evt){
map.graphics.enableMouseEvents();
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setTitle(evt.graphic.attributes.facil_name);
infoTemplate.setContent("<b>${facil_name}</b>");
map.infoWindow.resize(245,125);
var highlightSym = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([255,0,0]), 1),
new dojo.Color([0,255,0,0.25]));
evt.graphic.setInfoTemplate(infoTemplate);
var content = evt.graphic.getContent();
map.infoWindow.setContent(content);
var title = evt.graphic.getTitle();
map.infoWindow.setTitle(title);
highlightGraphic = new esri.Graphic(evt.graphic.geometry,highlightSym);
map.graphics.add(highlightGraphic);
map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));
}
function hideHoverPopup(evt){
map.graphics.remove(highlightGraphic);
}
... View more
07-19-2012
02:25 PM
|
0
|
5
|
2219
|
|
POST
|
anyone ever get this error in manager log? It happens from time to time when someone accesses the JS api web map. Seems like it's related to the sql server sde geodatabase, I never saw the problem with a file geodatabase being hosted. directly following the spatial filter invalid error, this is always posted in manager log: Method failed.HRESULT = 0x80041251 : This is a FACILITY_ITF error that is specific to the interface that returned this error. See the documentation of the interface that returned this error for information about this HRESULT. any advice? Thanks
... View more
07-18-2012
09:58 AM
|
0
|
1
|
923
|
|
POST
|
after some brainstorming, I decided to do away with the identifyTask and replace it with a findTask when a grid row click is detected. The existing code to process the response can remain exactly the same since both the identifyTask and findTask returns a dojo.deferred incase anyone's interested, here's the solution:
function executeIdentifyTask(evt) {
if (evt.mapPoint == undefined){
//grid click, lets switch to a find task
anchorPt = evt.geometry;
siteCode = evt.attributes.site_code[0];
lids.push(0);
var findTask2 = new esri.tasks.FindTask("https://mydomain.com/MapServer/");
var fParams = new esri.tasks.FindParameters();
fParams.searchText = siteCode;
fParams.returnGeometry = true;
fParams.searchFields = ["site_code"];
fParams.layerIds = lids; //set lids to include only facil layer
fParams.contains = false;
var deferred = findTask2.execute(fParams);
}
else{
//map click;
identifyParams.tolerance = 5;
anchorPt = evt.mapPoint;
//since LAYER_OPTION_VISIBLE only pertains to scale visibility, not TOC checked/not checked, we have to manually set the identifyParams.layerIds
dojo.forEach(legendLayers, function(layer){
//layer must be checked in toc AND not be parcels, bndry or prtct;
if (layer.layer.visible === true && (!(layer.layer.id == "parcels" || layer.layer.id == "bndry" || layer.layer.id == "prtct"))){
lids.push(map.getLayer(layer.layer.id).layerId); //set lids to include all visible facilities
}
})
//click dependent identifyparams
identifyParams.layerIds = lids;
identifyParams.width = map.width;
identifyParams.height = map.height;
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
identifyParams.geometry = anchorPt;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask.execute(identifyParams);
}
deferred.addCallback(function(response) {
//set esri.dijit.PopupTemplate for each layer
});
};
... View more
07-03-2012
05:57 AM
|
0
|
0
|
491
|
|
POST
|
the executeIdentifyTask function is fired from either a map click or grid row click. Since the executeIdentifyTask is responsible for identifying/formatting/displaying popups, I'd like to use the existing executeIdentifyTask to display a popup after a grid row click. If a grid click, I want to display the popup, stripping out any close-by identify results that may have been included. If grid click, I lower the identifyParams.tolerance, but I still pickup a few unwanted results around the facility point geometry that was grid-clicked
dojo.connect(grid1, "onRowClick", onRowClickHandler);
dojo.connect(map,"onClick",executeIdentifyTask);
function onRowClickHandler(evt){
var selectedFac;
//other non-pertinent code
map.centerAndZoom(selectedFac.geometry, 15);
executeIdentifyTask(selectedFac);
}
function executeIdentifyTask(evt) {
var lids = []; //array to hold layer id's to identify
var anchorPt; //facility point, substitute for a mouse click
var siteCode; //id for the grid row that was clicked
var j; //index of response object that was grid clicked
var res; //filtered array of response objects
//lets detect if this was fired by a map click or a grid click
if (evt.mapPoint == undefined){
//grid click, only identify the facility point corresponding to the grid row that was clicked i.e. lower identify tolerance
identifyParams.tolerance = 1;
anchorPt = evt.geometry;
siteCode = evt.attributes.site_code;
//set lids to include only facil layer
lids.push(0);
}
identifyParams.layerIds = lids;
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function(response) {
if (!(siteCode == undefined)){
for (var i in response){
var fac = response;
if (fac.feature.attributes.site_code == siteCode){
j = i;
break;
}
}
res = response ;
}
else{
//no filtering the identify response; this was fired by map click
res = response;
}
return dojo.map(res, function(result) {
//if res is set to response , script never gets here, ends at break above <----problem
var feature = result.feature;
//esri.dijit.PopupTemplate's set here
return feature;
}
})
}
any advice would be great! Thanks.
... View more
07-02-2012
10:50 AM
|
0
|
1
|
828
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 05-02-2024 04:44 PM | |
| 1 | 11-04-2025 11:45 AM | |
| 1 | 10-31-2025 06:53 AM | |
| 1 | 02-06-2019 06:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|