POST
|
Hi, I don't think that possible using ArcGISDynamicMapServiceLayer. ArcGISDynamicMapServiceLayer does not have the method 'setLabelingInfo'. You can use a FeatureLayer as described here: Labeling features client-side | Guide | ArcGIS API for JavaScript I guess the documentation for 'LabelClass' is a bit misleading. I don't understand the property 'labelExpression'.. To add labels to arcGISDynamicMapServiceLayer you can set up labels in you mxd before publishing.
... View more
01-21-2016
04:23 AM
|
0
|
0
|
1995
|
POST
|
I looked at this together with Anders, this is what we found: The where clause must be encoded before sending the request. Often simple quotation marks (') are used in the where clause, and some browsers seems to encode simple quotation marks and others don't. What probably happens is that the API encodes the where-clause, and it does not encode simple qutation marks. The API then checks if the total url length is more than 2000(?) characters, if so it uses POST instead of GET. But in our case FireFox did also encode the simple qutation marks, resulting that the request url length was larger than 2000 characters and still using GET method. This resulted in response error. Simple marks quotation (') is encoded as %27 http://www.w3schools.com/tags/ref_urlencode.asp Javascript function encodeURI() does not encode simple quotation marks.
... View more
12-04-2013
01:45 AM
|
0
|
1
|
312
|
POST
|
I'm using Esri js api 3.7 and "esri/layers/WMSLayer" to add WMS layers to my map. The WMS GetCapabilities response has content-type application/vnd.ogc.wms_xml (from MapServer). In Chrome (v. 31.x) the xhr object returns null, and not the xml document. It works fine in FireFox. So the capability xml file is not loaded, and the wms does not show up in the map. It seems like Chrome does not handle the response as text/xml, and instead returns null. If I change the response content-type from application/vnd.ogc.wms_xml to text/xml (using Fiddler), it also works in Chrome. Has anyone else have experiences this? I have found 2 workarounds: 1) Create an resourceInfo object(optional parameter in creating wms layer). This prevents the GetCapabilities request. There are many services and layers, so this is not an prefered option.. 2) Use my own old custom WMS-layer object(inherit esri/layers/TiledMapServiceLayer). It does not ask for GetCapabilities. Any other tips/workarounds? Should the Esri js api handle this? -Endre
... View more
12-03-2013
11:54 PM
|
0
|
4
|
3208
|
POST
|
Sorry about a quick answer that gave nothing new to the thread.. But I have done this using AMD & JS-API v 3.5. It worked fine. Added an example to jsfiddler (basically the same as Derek Swingley did). Hope this helps 🙂
... View more
08-05-2013
12:10 AM
|
0
|
0
|
677
|
POST
|
Derek Swingley answered this in this thread with link to example on jsfiddle
... View more
08-02-2013
04:58 AM
|
0
|
0
|
677
|
POST
|
I just includes some public WMTS layers in a javascript app using JS API 3.5: Url to WMTS:http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts? I did found some small bugs that might be helpful to know about: 1) Typo error in wmst.js that has been there for a while (read thread) 2) Error in PrintTask when printing wmts layers. In function "_createOperationalLayers(map)", case "esri.layers.WMTSLayer", the code expects the layer to have an layerInfo array. It does not. So I changed the code: Old: layer: _3d.layerInfos[0].identifier,
style: _3d.layerInfos[0].style,
format: _3d.layerInfos[0].format,
tileMatrixSet: _3d.layerInfos[0].tileMatrixSet New: layer: _3d.layerInfo.identifier,
style: _3d.layerInfo.style,
format: _3d.layerInfo.format,
tileMatrixSet: _3d.layerInfo.tileMatrixSet Finally I could create a PDF using wmts as baselayer, but the wmts layer offsets to an ArcGISDynamicMapServiceLayer. Both having the same SpatialReference(EPSG:32633). I tried to open the data in ArcMap 10.1. But ArcMap did not show any WMTS data at all! Anyone know if this is related to this known bug? (http://support.esri.com/en/bugs/nimbus/TklNMDg0ODA2) The WMTS I connect to only offers "KVP" as serviceMode. Any known workaround to create print combinding WMTS and ArcGISDynamicMapServiceLayer with no offset?? Attached screendump showing offset. One using WMTS as basemap, the other using ArcGISTiledMapServiceLayer as basemap. [ATTACH=CONFIG]26376[/ATTACH] [ATTACH=CONFIG]26377[/ATTACH] Thanks, Endre
... View more
08-01-2013
05:04 AM
|
0
|
0
|
654
|
POST
|
Additional question to Class Draw: If I would like to change the text in the Draw toolbar, I am using the esri.bundle as explained in the documentation: http://developers.arcgis.com/en/javascript/jsapi/draw-amd.html Ex: esri.bundle.toolbars.draw.addPoint = "Add a new tree to the map"; Using AMD it fails referencing esri.bundle. Is there any AMD compliant for esri.bundle?
... View more
04-05-2013
03:31 AM
|
0
|
0
|
583
|
POST
|
After updating to v3.4 I do get an "Error: multipleDefine" from dojoLoader on esri/toolbars/Draw. I tried to update the Esri JS-API Draw example to use AMD, and I got the same error. Also got the same Error using "esri/toolbars/Navigation". Is Draw and Navigation included in other items like Map, using another namestyle (like "draw" instead of "Draw")? Any idea what is going on? -Endre Draw example using AMD that fails: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Maps Toolbar</title> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } </style> <script></script> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"></script> <script> define([ "dojo/ready", "esri/map", "esri/toolbars/Draw", "esri/graphic", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "dojo/_base/Color", "dojo/_base/connect", "dijit/layout/ContentPane", "dijit/layout/BorderContainer", "dijit/form/Button", "dojo/parser" ],function(ready, Map, Draw, Graphic, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Color, connect){ ready(function () { var map, toolbar, symbol, geomTask; function init() { map = new Map("map", { basemap: "streets", center: [-15.469, 36.428], zoom: 3 }); connect.connect(map, "onLoad", createToolbar); } function createToolbar(themap) { toolbar = new Draw(map); connect.connect(toolbar, "onDrawEnd", addToMap); } function addToMap(geometry) { toolbar.deactivate(); map.showZoomSlider(); switch (geometry.type) { case "point": var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,0,0]), 1), new Color([0,255,0,0.25])); break; case "polyline": var symbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new Color([255,0,0]), 1); break; case "polygon": var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25])); break; case "extent": var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25])); break; case "multipoint": var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 20, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,0,0]), 1), new Color([255,255,0,0.5])); break; } var graphic = new Graphic(geometry, symbol); map.graphics.add(graphic); } init(); }) }); </script> </head> <body class="claro"> <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline'" style="width:100%; height:100%;"> <div id="header" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'" style="height:75px;text-align:left;font-weight:bold;font-size:14px;color:#400D12;overflow:hidden;"> <span>Draw:<br /></span> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POINT);map.hideZoomSlider();}">Point</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.MULTI_POINT);map.hideZoomSlider();}">Multipoint</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.LINE);map.hideZoomSlider();}">Line</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POLYLINE);map.hideZoomSlider();}">Polyline</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POLYGON);map.hideZoomSlider();}">Polygon</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.FREEHAND_POLYLINE);map.hideZoomSlider();}">Freehand Polyline</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.FREEHAND_POLYGON);map.hideZoomSlider();}">Freehand Polygon</button> <!--The Arrow,Triangle,Circle and Ellipse types all draw with the polygon symbol--> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.ARROW);map.hideZoomSlider();}">Arrow</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.TRIANGLE);map.hideZoomSlider();}">Triangle</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.CIRCLE);map.hideZoomSlider();}">Circle</button> <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.ELLIPSE);map.hideZoomSlider();}">Ellipse</button> </div> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"> </div> </div> </body> </html>
... View more
04-04-2013
03:17 AM
|
0
|
4
|
3432
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|