|
POST
|
How do I override the feature layer's onclick to check if the point clicked is within the "AIP" There are probably a couple of ways you could approach this. One might be: - add FeatureLayer1 to the map, but don't assign it an infoWindow - add the AIP layer/graphic to the map - set an onClick listener on the AIP layer, which does something like this:
dojo.connect(AIPlayer, "onClick", function(evt) {
var graphic = evt.graphic;
var attributes = evt.graphic.attributes;
var infoTemplate = new esri.InfoTemplate;
//1. set the infoTemplate's Contents and Title using the attributes
//2. attach the infoTemplate to map.infoWindow
//3. display the map's infoWindow at evt.mapPoint
});
... View more
05-23-2012
03:23 AM
|
0
|
0
|
697
|
|
POST
|
Hi David, I think the map's onClick handler isn't being initiated because it's not sitting inside a function. Try moving that listener immediately underneath the map declaration (eg around line 368). I'll also want to hide the infoWindow if scale changes beyond the visible scale range for the layer This is a bit trickier since the API doesn't directly tell you whether a layer is "on but outside its scale range". See the post here for some pointers you may be able to use. You may need to hard-code something in your code, then check the current scale range on each zoom change. Good luck, Steve
... View more
05-22-2012
02:41 PM
|
0
|
0
|
1340
|
|
POST
|
Where can I find information on properties and methods for esri.dijit.editing.Editor? Is it possible to 'pause' editing? See http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/editor.htm, which says: Attribute edits are saved automatically when you change selection, change the focus field, or press enter. Geometry edits are saved automatically. Steve
... View more
05-22-2012
02:08 PM
|
0
|
0
|
548
|
|
POST
|
I am able to offset the overlapping lines in ArcMap using the symbology settings and save my MXD document. It's possible/likely that the JS API doesn't support these settings in a featureLayer - cartographicLineSymbol doesn't seem to have an offset parameter. Are you able to use a dynamic layer instead? Steve
... View more
05-22-2012
02:02 PM
|
0
|
0
|
4596
|
|
POST
|
This should be possible, but can you provide more information - where are you attempting to get the field name (eg when running an Identify, when formatting the results of an infoWindow, etc)? Are you working with a feature layer, dynamic layer, graphic, etc? Do you have any sample code showing the problem you're facing? This may help to show where/how to obtain the field via its alias in your circumstances. Cheers, Steve
... View more
05-22-2012
01:57 PM
|
0
|
0
|
1902
|
|
POST
|
I want to save the attributes of the feature I just clicked moments before. How do I know what feature I just clicked? There are probably a bunch of ways you could approach this - here is one suggested method: dojo.connect(featureLayer, "onClick", function(evt) { console.log(evt.graphic.attributes); }); Steve
... View more
05-22-2012
01:53 PM
|
0
|
0
|
1088
|
|
POST
|
See the Format Infowindow help entry for instructions on rounding the numbers.
... View more
05-19-2012
10:42 PM
|
0
|
0
|
595
|
|
POST
|
any IDE you recommend? I don't use VS, but I find Espresso great on a Mac, and Free JavaScript Editor useful on a PC. Neither offers the same level of functionality as VS, to my knowledge. Cheers, Steve
... View more
05-16-2012
07:45 PM
|
0
|
0
|
1401
|
|
POST
|
Dave, I haven't tested this, but you could try setting the map's infoWindow content and title directly:
map.infoWindow.setTitle(layer.layerName);
map.infoWindow.setContent(contStr);
map.infoWindow.show(identPnt);
Off-topic, but rather than doing this:
if (layer.geometryType == 'esriGeometryPolygon') {
...
}
else if (layer.geometryType == 'esriGeometryPolyline') {
...
}
else if (layer.geometryType == 'esriGeometryPoint' || layer.geometryType == 'esriGeometryMultipoint') {
...
}
else {
...
}
you could use a SWITCH statement, which is more efficient as it only needs to evaluate once. Good luck, Steve
... View more
05-16-2012
05:40 PM
|
0
|
0
|
806
|
|
POST
|
I should be able to find my REST services with a path that follows: http://<host>/<root>/services But, I do not see a services folder when I drill down into the actual files John, It sounds like you need to take a step back and ensure that ArcGIS Server is installed and functioning correctly, before you can start making maps with its contents. There is a separate forum for the REST API where there are probably some people better able to assist you with that. You want to end up with a situation whereby you can browse your server's REST services directory like this sample server. Once you get to that stage, you can start adding these services to your maps. Cheers, Steve
... View more
05-16-2012
05:30 PM
|
0
|
0
|
2050
|
|
POST
|
John, Jay's first link will show you how to get your datasets published via ArcGIS Server. Once you've done that you'll want to make a map which uses that data. Since you're in the JavaScript API section of the forum, you probably want to use the JavaScript API. If so, take a look at the Samples page to get started. A suggestion is to get a sample working, then switch out the Esri sample data with your own data. Eg, take this sample and add your own layers on top of the basemap. Good luck, Steve
... View more
05-15-2012
05:36 PM
|
0
|
0
|
2050
|
|
POST
|
Is a polygon tiled layer used as a basemap considered a graphic? Or only the dynamic feature layer? Hi David, No, a tiled or dynamic layer isn't considered a graphic. A feature layer is, as is a graphics layer, or a single graphic. Can you post your whole code, or a link to your site? Cheers, Steve
... View more
05-15-2012
05:18 PM
|
0
|
0
|
1341
|
|
POST
|
But clicking on a graphic would then also constitute a click on the map You can trap for that using: dojo.connect(map, "onClick", function(evt) { if(!evt.graphic) { console.log("map click"); } });
... View more
05-13-2012
08:09 PM
|
0
|
0
|
3359
|
|
POST
|
That just seems to hide the infoWindow as soon as it's shown - it's only up for a second. It sounds like you might be using a mouse click on the map to open the infoWindow in the first place? What's displayed in the infoWindow - can you trigger it to open when you click on something else( a feature, graphic, or layer) instead? Steve
... View more
05-13-2012
06:48 PM
|
0
|
0
|
3359
|
|
POST
|
I tried setting a dojo.connect event handlers like dojo.connect(map, "onClick", map.infoWindow.hide()); but that doesn't seem to work. Try this instead:
dojo.connect(map, "onClick", function() {
map.infoWindow.hide();
});
... View more
05-13-2012
04:02 PM
|
0
|
0
|
3359
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-17-2014 08:45 PM | |
| 1 | 03-15-2011 04:23 PM | |
| 1 | 10-18-2019 12:50 AM | |
| 3 | 01-22-2019 02:33 PM | |
| 1 | 09-26-2011 10:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-20-2022
12:19 AM
|