|
POST
|
Where you have the "agsjs" directory versus the html file? For example, I have this setup [ATTACH=CONFIG]32869[/ATTACH] and in the html file I'm running (TOC_hide_node.html), I set the path to the TOC like this
<script>
var dojoConfig = {
packages: [
{
name: "agsjs",
location: location.pathname.replace(/\/[^/]+$/, "") + '../../agsjs'
}]
};
</script>
... View more
04-07-2014
06:06 AM
|
0
|
0
|
914
|
|
POST
|
Nice addition! The one thing I noticed is that the layers that get turned off automatically don't get closed like when you manually turn them off. If you have several services in your TOC and want only one service to have this new capability, use the id of the service like this
toc.on('toc-node-checked', function (evt) {
if (evt.checked && (evt.rootLayer.id === "theID") && evt.serviceLayer) {
evt.rootLayer.setVisibleLayers([evt.serviceLayer.id]);
}
});
... View more
04-04-2014
11:56 AM
|
0
|
0
|
3185
|
|
POST
|
I have two ArcGIS.com accounts, one is from my Esri Global Account and another is an organizational account. The popup box will only work when I log into the organization account.
... View more
04-03-2014
08:32 AM
|
0
|
0
|
2137
|
|
POST
|
Could you put together a Fiddle that's a simplified version of this that replicates the problem?
... View more
04-03-2014
06:28 AM
|
0
|
0
|
2349
|
|
POST
|
You'll have to declare the variable BufferClick outside the BufferTool function so that it can be referred in other functions (read up on variable scope). Something like
var map;
var BufferClick;
require(["esri/map", etc
function BufferTool(map) { //although if you declared map outside the require, you don't need to pass it like this
// code for function
//when the map is clicked create a buffer around the click point of the specified distance.
BufferClick = app.map.on("click", function(evt){
//define input buffer parameters
var params = new BufferParameters();
params.geometries = [ evt.mapPoint ];
params.distances = [ 10 ];
params.unit = GeometryService.UNIT_STATUTE_MILE;
geometryService.buffer(params);
});
// rest of code in function
... View more
04-02-2014
12:46 PM
|
0
|
0
|
2349
|
|
POST
|
Since you still connecting the click event in that function, you'll have to disconnect it.
... View more
04-02-2014
11:45 AM
|
0
|
0
|
2349
|
|
POST
|
If you're using an IDE that has debugging, you can pause it and examine esriBundle. That's how I was able to find the right property in this thread.
... View more
04-02-2014
11:44 AM
|
2
|
0
|
7284
|
|
POST
|
I tried the below....I also tried defining mapOnClick outside the app.map.on it just keeps running the Buffer code when i Click the map. I am going to try and put a JSFiddle together.
app.map.on("click", function () {
app.map.infoWindow.hide();
clearContent();
});
app.map.infoWindow.on("hide", clearContent);
on(dom.byId("button1"), "click", function () {
// I TRIED THIS
initializeSidebar(app.map);
// AND THIS
var mapOnClick2 = connect.connect(app.map, "onClick", initializeSidebar(app.map))
//Clear Graphic Circle from BufferTool
app.map.graphics.clear();
clearContent();
dijit.byId("Tools").set('open',false); //Close
// TRIED THIS
connect.disconnect(mapOnClick);
// AND THIS
mapOnClick.remove();
})
on(dom.byId("button2"), "click", function () {
app.map.infoWindow.hide();
clearContent();
var mapOnClick = connect.connect(app.map, "onClick", BufferTool(app.map))
// CLOSE THE PANE WHEN SELECTED
dijit.byId("Tools").set('open',false); //Close
})
What do you have in the BufferTool function? Are you still adding the event app.map.on("click", function(evt) If so, you'll have to disconnect that if you click the Identify button.
... View more
04-02-2014
11:24 AM
|
0
|
0
|
2875
|
|
POST
|
I read through adn still a bit confused...I tried something like this The Buffer code runs, but I still cant turn it off...am I close???? THANK YOU
on(dom.byId("IDENTIFY"), "click", function () {
initializeSidebar(app.map);
//Clear Graphic Circle from BufferTool
app.map.graphics.clear();
clearContent();
connect.disconnect(BufferTool(app.map));
})
on(dom.byId("BUFFER"), "click", function () {
app.map.infoWindow.hide();
clearContent();
mapOnClick = connect.connect(map, "onClick", BufferTool(app.map))
// CLOSE THE PANE WHEN SELECTED
dijit.byId("Tools").set('open',false); //Close
})
Have you tried
on(dom.byId("IDENTIFY"), "click", function () {
initializeSidebar(app.map);
//Clear Graphic Circle from BufferTool
app.map.graphics.clear();
clearContent();
connect.disconnect(mapOnClick);
})
and if you're using API 3.6 or higher, you should look at converting "connect.connect" to "on", since support for connect will be removed in Dojo 2.0
... View more
04-02-2014
11:03 AM
|
0
|
0
|
2875
|
|
POST
|
In the BufferTool function, you add an event listener for the map click. app.map.on("click", function(evt) You could disconnect this event listener when the Identify Button is pressed (see the Event help topic) or use a variable to short circuit that click event. Something like
app.map.on("click", function(evt){
//define input buffer parameters
if (CanRunBuffer) {
var params = new BufferParameters();
params.geometries = [ evt.mapPoint ];
params.distances = [ 50 ];
params.unit = GeometryService.UNIT_STATUTE_MILE;
geometryService.buffer(params);
}
});
... View more
04-02-2014
08:55 AM
|
0
|
0
|
2875
|
|
POST
|
Thanks to all that helped, I'm going to consider this thread closed now. You should consider clicking the up arrow on the posts that were helpful and click the check mark on the post (even if it's yours) on what you consider to be the best answer (see this page for more detail). This will help others who may be searching on this type of question
... View more
04-01-2014
11:02 AM
|
0
|
0
|
1012
|
|
POST
|
You forgot showAttribution:false as Jonathan had posted
... View more
04-01-2014
06:56 AM
|
0
|
0
|
1830
|
|
POST
|
I suspect it has to do with the Map.reposition() line. Does this need to be called every time you click on the map? I'm guessing that the first time you click on the map, the map gets repositioned and the point that you clicked isn't the same in the new position.
... View more
04-01-2014
06:52 AM
|
0
|
0
|
1445
|
|
POST
|
Of the many samples that use Query, several (like this, this, and this)https://developers.arcgis.com/javascript/jssamples/query_showinfowindow.html use it on a dynamic map service.
... View more
03-27-2014
12:58 PM
|
0
|
0
|
530
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 2 weeks ago | |
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|