|
POST
|
Yes, your feature layer needs an OID field. Do you see a message about this in the firebug or chrome dev tools console? What is the format for the underlying data?
... View more
07-22-2011
07:00 AM
|
0
|
0
|
1773
|
|
POST
|
I understand, but at v2.4, you're limited to the classes I listed above. What are you doing in your custom class?
... View more
07-21-2011
09:20 PM
|
0
|
0
|
1024
|
|
POST
|
Thanks. This is probably a bug but I'll post back once I'm sure.
... View more
07-21-2011
05:43 PM
|
0
|
0
|
1660
|
|
POST
|
... when I query a point or polyline (and alter the /MapServer/# and the outFields accordingly), my query returns 0 results (it is a valid query). I'm wondering if it has something to do with the spatial relationship? I've attempted to max out the maxAllowableOffset, but that doesn't seem to alter anything. Does anyone have any ideas on this? maxAllowableOffset isn't used to buffer your query point; it's actually used to generalize the features returned from the server. If you're querying points, it doesn't do anything. I wrote a blog post about this a while back: Generalize features on the fly. Also see Determining limits for map graphics for more info on maxAllowableOffset. Unfortunately, query doesn't have a tolerance like the identify task parameters but you can build it yourself. Do something like this:
var pixelWidth = map.extent.getWidth() / map.width,
queryTolerance = pixelWidth * 3,
queryGeom = new esri.geometry.Extent({
'xmin': evt.mapPoint.x - queryTolerance,
'ymin': evt.mapPoint.y - queryTolerance,
'xmax': evt.mapPoint.x + queryTolerance,
'ymax': evt.mapPoint.y + queryTolerance
});
queryFilter.geometry = queryGeom;
Basically, use the width of a pixel * 3 as your tolerance, use that to build an extent which is then used in your query instead of a point.
... View more
07-21-2011
04:12 PM
|
0
|
0
|
2137
|
|
POST
|
Try changing "dynamicLayer" to "layer" in your legend's layerInfos object.
... View more
07-21-2011
03:57 PM
|
0
|
0
|
812
|
|
POST
|
What do you mean by scrolling? Can you post some code that reproduces what you're seeing? The popup sample shows a popup without panning or zooming the map- just click a feature and the popup appears.
... View more
07-21-2011
03:46 PM
|
0
|
0
|
2448
|
|
POST
|
This sounds like a basic SQL question. If you want to search for a specific event type, add that to your where clause: query.where = 'someField = "someValue" AND eventType = "Conference"' Otherwise, just leave the eventType out of your where clause. If there's nothing to filter your data, use query.where = '1=1'.
... View more
07-21-2011
11:28 AM
|
0
|
0
|
825
|
|
POST
|
The doc for the legend dijit lists the supported legend types: The legend supports the following layer types: ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, FeatureLayer. If the layer is an ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer created using ArcGIS Server 10.0 SP1 or higher the legend is generated using the REST Map Service legend resource. KMLLayers are also supported. We'll update the doc to reflect this.
... View more
07-21-2011
10:26 AM
|
0
|
0
|
1024
|
|
POST
|
Depends on the underlying datastore. The where property of a query gets passed through to the database. To get all values, you could use: query.where = '1=1'; This will return all values until you hit the max results for your map service (at 9.3, it's 500 records, at 10, it's 1000 records). If you don't want to use the 1=1 approach, watch out for string formatting...be sure you have all your single and double quotes in the right place.
... View more
07-21-2011
10:07 AM
|
0
|
0
|
825
|
|
POST
|
Hi Mark, The editor can manage undo/redo for you. I tweaked the Edit Points of Interest sample to show this (remember to update the proxy): <!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9" />
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Editing Points with Undo/Redo</title>
<!-- include dojo theme -->
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/dojo/dijit/themes/claro/claro.css">
<style type="text/css">
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
overflow:hidden;
background:#fff;
}
#header{
border: solid 1px #232416;
color:#453823;
font-weight:600;
font-size:14px;
height:40px;
}
#map{
border: solid 1px #232416;
padding:0;
}
#leftPane{
width:200px;
border:none;
}
.templatePicker {
border:solid 2px #232416 !important;
}
.dj_ie .infowindow .window .top .right .user .content { position: relative; }
.dj_ie .simpleInfoWindow .content {position: relative;}
.esriAttributeInspector .atiRichTextField .dijitEditorIFrameContainer{
height:60px;
}
</style>
<script type="text/javascript">
dojoConfig = {
parseOnLoad:true
};
</script>
<!-- reference ArcGIS JavaScript API -->
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4"></script>
<script type="text/javascript">
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
dojo.require("esri.map");
dojo.require("esri.dijit.editing.Editor-all");
dojo.require("esri.dijit.editing.editOperation");
dojo.require("esri.undoManager");
var map, resizeTimer, myEditor;
function init() {
// Specify your proxy URL
esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer");
var initialExtent = new esri.geometry.Extent({"xmin":-13114358,"ymin":4069927,"xmax":-13097981,"ymax":4077246,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", { extent: initialExtent });
dojo.connect(map, "onLoad", function() {
dojo.connect(dijit.byId('map'), 'resize', function() {
resizeMap();
});
});
dojo.connect(map, "onLayersAddResult", initEditor);
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
map.addLayer(basemap);
var pointsOfInterest = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ['*']
});
dojo.connect(pointsOfInterest, 'onLoad', function(poi) {
poi.setSelectionSymbol(new esri.symbol.SimpleMarkerSymbol('circle', 32, null, new dojo.Color([0, 0, 0, 0.25])));
});
map.addLayers([pointsOfInterest]);
}
function initEditor(results) {
var layers = dojo.map(results, function(result) {
var fieldInfos= dojo.map(result.layer.fields,function(field){
if(field.name === 'description'){
return {'fieldName': field.name,'label':'Details',stringFieldOption:esri.dijit.AttributeInspector.STRING_FIELD_OPTION_RICHTEXT,richTextPlugins:['undo','redo','bold', 'italic']}
}
else{
return {'fieldName': field.name,'label':field.alias}
}
});
return {featureLayer:result.layer,'fieldInfos':fieldInfos}
});
var templateLayers = dojo.map(results,function(result){
return result.layer;
});
var templatePicker = new esri.dijit.editing.TemplatePicker({
featureLayers: templateLayers,
rows: 'auto',
columns: 'auto',
style:'height:98%;width:98%;'
},'templatePickerDiv');
templatePicker.startup();
// Create Editor and specify an undoManager
var undoManager = new esri.UndoManager();
var settings = {
templatePicker: templatePicker,
map: map,
layerInfos:layers,
toolbarVisible: false,
enableUndoRedo: true,
undoManager: undoManager
}
var params = {settings: settings};
myEditor = new esri.dijit.editing.Editor(params);
myEditor.startup();
map.infoWindow.resize(275,220);
dojo.connect(dojo.byId('undo'), 'onclick', function(click) {
if ( myEditor.undoManager.canUndo ) {
myEditor.undoManager.undo();
console.log('called undo');
} else {
alert('Nothing to undo.');
}
});
dojo.connect(dojo.byId('redo'), 'onclick', function(click) {
if ( myEditor.undoManager.canRedo ) {
myEditor.undoManager.redo();
console.log('called redo');
} else {
alert('Nothing to redo.');
}
});
}
//Handle resize of browser
function resizeMap(){
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function(){
map.resize();
map.reposition();
}, 500);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="gutters:true, design:'sidebar'" style="width:100%;height:100%;">
<div data-dojo-type="dijit.layout.ContentPane" id="header" data-dojo-props="region:'top'">
Fire Map
<div class="undoButtons">
<button id="undo" data-dojo-type="dijit.form.Button">
Undo
</button>
<button id="redo" data-dojo-type="dijit.form.Button">
Redo
</button>
</div>
</div>
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'"></div>
<div id="leftPane" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'left'">
<div id="templatePickerDiv"></div>
</div>
</div>
</body>
</html>
... View more
07-21-2011
09:41 AM
|
0
|
0
|
2763
|
|
POST
|
Can you post a link to your KML file? As the KMLLayer was introduced at 2.4, and there numerous possibilities when it comes to KML, it's possible we might not be handling your file correctly.
... View more
07-21-2011
06:31 AM
|
0
|
0
|
1660
|
|
POST
|
The simplest solution is to not put the toolbar inside the map's div. We discussed this recently in another thread: http://forums.arcgis.com/threads/32706-Pan-arrows Also, if you only want to zoom in, why not include a note in your app that you can zoom in by holding shift + clicking and dragging a box? If you don't need the other nav toolbar functions, I think that would be the ideal solution.
... View more
07-19-2011
01:04 PM
|
0
|
0
|
583
|
|
POST
|
Yes, you can do this by using the attribute inspector. See this sample: Using the Attribute Inspector. To edit multiple layers, add additional objects to the layerInfos array.
... View more
07-19-2011
11:41 AM
|
0
|
0
|
939
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|