|
POST
|
Making navToolbar a global variable should solve the issue. So change the code like: <script>
var map, navToolbar;
require([...], function(...) {
...
navToolbar = new Navigation(map);
});
</script>
... View more
10-25-2013
10:17 AM
|
0
|
0
|
578
|
|
POST
|
You can define a onClick event handler for the feature layer for edit. Here is the code snippet. editTool is an esri/toolbars/edit type object that should be initialized somewhere. var clickActions = esri.toolbars.Edit.MOVE |
esri.toolbars.Edit.ROTATE |
esri.toolbars.Edit.SCALE |
esri.toolbars.Edit.EDIT_VERTICES;
featureLayer.on("click", function(evt) {
dojo.stopEvent(evt);
editTool.activate(clickActions, evt.graphic);
}); Here is the ESRI editing sample w/o using Editor widget. Hope it helps.
... View more
10-21-2013
09:46 AM
|
0
|
0
|
664
|
|
POST
|
Calling resize() might be the easiest way. Controlling the popup size via css is not easy and may not be a good idea since different feature layer may have different set of attributes which will require the popup able to adjust its size dynamically.
... View more
10-21-2013
08:23 AM
|
0
|
0
|
975
|
|
POST
|
ionara, you just posted this thread for changing the width and height yesterday. It does not work any more?
... View more
10-18-2013
02:32 PM
|
0
|
0
|
975
|
|
POST
|
Here is the revised code. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"> <!--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>Edit rivers and waterbodies</title> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css" /> <style> html,body{height:100%;width:100%;margin:0;overflow:hidden;} #map{ padding:0; } #header{ font-size: 1.1em; font-family: sans-serif; padding-left: 1em; padding-top:4px; color:#660000; } .templatePicker { border: none; } .dj_ie .infowindow .window .top .right .user .content { position: relative; } .dj_ie .simpleInfoWindow .content {position: relative;} .esriAttributeInspector .atiMyButton { float: left; margin: 0px; } </style> <script src="http://js.arcgis.com/3.7/"></script> <script> var map; require([ "esri/map", "esri/toolbars/edit", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/FeatureLayer", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/dijit/editing/Editor", "esri/dijit/editing/TemplatePicker", "esri/config", "dojo/i18n!esri/nls/jsapi", "dojo/_base/array", "dojo/parser", "dojo/keys", "dojo/_base/Color", "dojo/dom-construct", "dojo/dom-class", "dijit/form/Button", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function( Map, Edit, ArcGISTiledMapServiceLayer, FeatureLayer, SimpleMarkerSymbol, SimpleLineSymbol, Editor, TemplatePicker, esriConfig, jsapiBundle, arrayUtils, parser, keys, Color, domConstruct, domClass, Button ) { parser.parse(); // snapping is enabled for this sample - change the tooltip to reflect this jsapiBundle.toolbars.draw.start = jsapiBundle.toolbars.draw.start + "<br>Press <b>ALT</b> to enable snapping"; // refer to "Using the Proxy Page" for more information: https://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html esriConfig.defaults.io.proxyUrl = "/proxy"; //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications. esriConfig.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); map = new Map("map", { basemap: "satellite", center: [-96.541, 38.351], zoom: 14, slider: false }); map.on("layers-add-result", initEditor); //add boundaries and place names var labels = new ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer"); map.addLayer(labels); var rivers = new FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1",{ mode: FeatureLayer.MODE_ONDEMAND, outFields: ['*'] }); var waterbodies = new FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/0",{ mode: FeatureLayer.MODE_ONDEMAND, outFields: ['*'] }); map.addLayers([waterbodies,rivers]); function initEditor(evt) { var templateLayers = arrayUtils.map(evt.layers, function(result){ return result.layer; }); var templatePicker = new TemplatePicker({ featureLayers: templateLayers, grouping: true, rows: "auto", columns: 3 }, "templateDiv"); templatePicker.startup(); var layers = arrayUtils.map(evt.layers, function(result) { return { featureLayer: result.layer }; }); var settings = { map: map, templatePicker: templatePicker, layerInfos: layers, toolbarVisible: true, createOptions: { polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ], polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON, Editor.CREATE_TOOL_CIRCLE, Editor.CREATE_TOOL_TRIANGLE, Editor.CREATE_TOOL_RECTANGLE ] }, toolbarOptions: { reshapeVisible: true } }; var params = {settings: settings}; var myEditor = new Editor(params,'editorDiv'); //define snapping options var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CROSS, 15, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0, 0.5]), 5 ), null ); map.enableSnapping({ snapPointSymbol: symbol, tolerance: 20, snapKey: keys.ALT }); var newButton = new Button({label: "My Button"}, domConstruct.create("div", null, myEditor.attributeInspector.editButtons, "first")); domClass.add(newButton.domNode, "atiMyButton"); myEditor.startup(); } }); </script> </head> <body class="claro"> <div id="main" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline'" style="height:width:100%;height:100%;"> <div data-dojo-type="dijit/layout/ContentPane" id="header" data-dojo-props="region:'top'"> Edit Hydrography </div> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left'" style="width: 300px;overflow:hidden;"> <div id="templateDiv"></div> <div id="editorDiv"></div> </div> <div data-dojo-type="dijit/layout/ContentPane" id="map" data-dojo-props="region:'center'"></div> </div> </body> </html>
... View more
10-18-2013
10:27 AM
|
0
|
0
|
975
|
|
POST
|
These new errors must be introduced by async: true. Your code looks kind of mixed mode: partial AMD and partial legacy. You might need to make it either pure AMD or legacy.
... View more
10-18-2013
06:32 AM
|
0
|
0
|
1406
|
|
POST
|
The main cause is that the map object is initialized before the dom elements are ready and parsed. When the map object is created, the dom element "map" occupies the whole page. That causes the offset of the popup. Do this. Change djConfig to below. Note you forgot to set async to true which is required for AMD mode. var djConfig = {
parseOnLoad: false,
async: true,
packages: [{
"name": "agsjs",
"location": location.pathname.replace(/\/[^/]+$/, "") + '/agsjs'
}]
}; Then, include "dojo/parser" to the dependency list, and set its alias to parser. require([
"dojo/parser",
"esri/map",
"esri/dijit/BasemapToggle",
"esri/dijit/HomeButton",
"esri/config",
"esri/dijit/Popup",
"dijit/dijit", // optimize: load dijit layer
"dijit/layout/BorderContainer", //HTML CONTAINER
"dijit/layout/ContentPane", //CONTAINER
"dijit/TitlePane", //CONTAINER
"esri/arcgis/utils", //Elements
"dijit/form/ToggleButton", //HTML
"dijit/form/Button", //HTML
"dijit/Dialog", //Required for Custom Splash Page
"esri/dijit/BasemapGallery", // Required for Basemap Gallery
"dijit/layout/AccordionContainer",
"dojo/fx", // needed if use jsapi 3.0
"agsjs/dijit/TOC",
"dojo/ready",
"dojo/domReady!"
], function(
parser, Map, BasemapToggle, HomeButton, esriConfig, Popup
) {
parser.parse(); // parse the page before the map is initialized.
... View more
10-18-2013
05:51 AM
|
0
|
0
|
1406
|
|
POST
|
There is one issue in your code. The position of "esri/dijit/Popup" module does not match the position in the alias list. Change the top part to: require([
"esri/map",
"esri/dijit/BasemapToggle",
"esri/dijit/HomeButton",
"esri/config",
"esri/dijit/Popup",
"dijit/dijit", // optimize: load dijit layer
"dijit/layout/BorderContainer", //HTML CONTAINER
"dijit/layout/ContentPane", //CONTAINER
"dijit/TitlePane", //CONTAINER
"esri/arcgis/utils", //Elements
"dijit/form/ToggleButton", //HTML
"dijit/form/Button", //HTML
"dijit/Dialog", //Required for Custom Splash Page
"esri/dijit/BasemapGallery", // Required for Basemap Gallery
"dijit/layout/AccordionContainer",
"dojo/fx", // needed if use jsapi 3.0
"agsjs/dijit/TOC",
"dojo/ready",
"dojo/domReady!"
], function(
Map, BasemapToggle, HomeButton, esriConfig, Popup
) {
... View more
10-17-2013
01:49 PM
|
0
|
0
|
1406
|
|
POST
|
I can see one problem. You defined the event handlers for yesAddButton and noAddButton inside the callback function of draw-end event. So every time when you draw a graphic, yesAddButton and noAddButton event handlers will be defined one time. It will end up that if you draw two graphics, applyEdits will be triggered twice; three graphics, call applyEdits three times, and so on. Move below code outside of dojo.connect(drawToolbar, "onDrawEnd", function(geometry) {...}); block. It should clear the issue. dojo.connect(yesAddButton, "onclick", function () { dijit.byId("addFeatureDialog").hide(); //when features are added - add them to the undo manager selectedTemplate.featureLayer.applyEdits([newGraphic], null, null, function() { var operation = new esri.dijit.editing.Add({ featureLayer: selectedTemplate.featureLayer, addedGraphics: [newGraphic] }); undoManager.add(operation); checkUI(); }); }); dojo.connect(noAddButton, "onclick", function () { dijit.byId("addFeatureDialog").hide(); });
... View more
10-17-2013
12:07 PM
|
0
|
0
|
1101
|
|
POST
|
More than likely, applyEdits is triggered multiple times. Without looking at the code, it's hard to tell how multiple triggers are defined. Can you post your code? It would be great if you can post your code in jsFiddle.
... View more
10-17-2013
11:38 AM
|
0
|
0
|
1101
|
|
POST
|
Does anyone have any luck to deploy a .NET SOE (Server Object Extension) on a linux server hosting ArcGIS Server 10.1? If so, can you share the steps how to do that? The .NET SOE we developed can be deployed to the windows server. But failed on linux box, complaining that the DLL is not found in the .SOE file, which is there. I've spent hours trying to find the information on ESRI online document, but found nothing useful. I was told that when installing ArcGIS Server on the linux box, a software called WINE installed along with it. WINE is a windows simulator, which I assume it might be useful to help deploy .NET component on the linux box. Of course, we can migrate our .NET SOE to java, and redeploy it. But we like to take that as the last option if that is the only option. Any comments, experience sharing or suggestions will be greatly appreciated. Thanks in advance. Jason
... View more
10-17-2013
07:09 AM
|
0
|
0
|
452
|
|
POST
|
We have developed a server object extension in Visual Studio 2010 using .NET 3.5 Framework, and successfully deployed to the ArcGIS Server 10.1 hosted on a windows box. However, when we try to deploy it to our linux server, it complains that the DLL is not found in the .SOE file, which actually contains. Is it possible to deploy a .NET SOE on a linux box? If so, what's the steps to deploy it? Thanks. Jason Zou
... View more
10-17-2013
06:57 AM
|
0
|
2
|
2277
|
|
POST
|
Glad to help:) Please consider to mark your question as "Answered" so that other people might find it helpful. Thanks.
... View more
10-17-2013
06:30 AM
|
0
|
0
|
1007
|
|
POST
|
You will need to translate the geometry dimension into screen dimension. Here is what I use. Convert the geometry dimension into screen dimension. geom should be either a polyline or polygon. var extScreenWidth = map.width * (geom.getExtent()).getWidth() / map.extent.getWidth(); var extScreenHeight = map.height * (geom.getExtent()).getHeight() / map.extent.getHeight(); Then round the numbers to convert into integers, and fed to exportOptions. printTemplate.exportOptions = { width: Math.round(extScreenWidth), height: Math.round(extScreenWidth), dpi: 96 };
... View more
10-17-2013
06:13 AM
|
0
|
0
|
1007
|
|
POST
|
I see what's going on. Since selectFeatures is an asynchronous function, the loop won't stop to wait until selectFeatures is complete. It will end up with when the first selectFeatures callback is invoked, the loop already completes, and featureLayertoSelect value will be the last feature layer for all the callbacks. This is a typical trap for async programming. Change: for (k = 0; k < mapServicesList.length; k++) {
featureLayertoSelect = mapServicesList ;
featureLayertoSelect.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (result) { selectFeatureCallBackFunc(featureLayertoSelect, result) }, errback);
} To: dojo.array(mapServicesList, function(aFeatureLayer) {
aFeatureLayer.selectFeatures(query,
esri.layers.FeatureLayer.SELECTION_NEW,
function (result) { selectFeatureCallBackFunc(aFeatureLayer, result); },
errback
);
} In the above code, aFeatureLayer is a function parameter which is local to each callback function for dojo.array, which in turn should differentiate from each other.
... View more
10-17-2013
05:27 AM
|
0
|
0
|
978
|
| 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
|