POST
|
Hi Robert, Thank you for your answer. I have uploaded an example of my map to our web server: Map Test And the code for my map is in this file. I hope, you can work with that. Regards, Raphael
... View more
06-10-2016
12:20 AM
|
0
|
2
|
843
|
POST
|
Hello I'm trying to add labels to a FeatureLayer with LabelClass on version 3.16 of the javascript API. I'm just displaying countries with different colors and trying to add the country name as a label. Unfortunately, some of the labels are placed at very strange places instead of in the center of the country. I have provided two examples in the attached screenshots. This is the code which I am using to add the labels: var featureLayer = new FeatureLayer(featureLayerPath, {
outFields: ['iso_a3', 'iso_a2', 'name']
});
featureLayer.setRenderer(this.renderer); // the renderer is defined earlier and works
var labelSymbol = new this.esri.TextSymbol({
font: new this.esri.Font('10', this.esri.Font.STYLE_NORMAL, this.esri.Font.VARIANT_NORMAL,
this.esri.Font.WEIGHT_NORMAL, 'Helvetica'),
color: new this.esri.Color('#000000')
});
var lc = new this.esri.LabelClass({
labelExpressionInfo: {value: '{name}'},
labelPlacement: 'center-center'
});
lc.symbol = labelSymbol;
featureLayer.setLabelingInfo([lc]);
map.addLayer(featureLayer);
I have already tried all possible options for the labelPlacement property, but this doesn't change anything. Does anyone have an idea what I might be doing wrong and how I could do it correctly? I'm thankful for any help!
... View more
06-03-2016
01:33 AM
|
0
|
4
|
3848
|
POST
|
Our ArcGIS 10.1 server is installed in a DMZ behind a web-proxy that terminates HTTPS and forwards HTTP to the ArcGIS server. Thus the connection between the web-proxy and the ArcGIS server is always HTTP even though the browser sees the ESRI map with HTTPS. This setup works fine until we use the virtual output directory in combination with the DynamicMapServiceLayer. The response of the export script (https://www.comfone.com/arcgis/rest/services/country_outline/MapServer/export?) points to a HTTP address instead of a HTTPS. Is there a configuration in ArcGIS 10.1 where I can define the virtual output directory path to be set to HTTPS? It seems that there was exactly this feature in a older version (section 3): 37035 - Access REST Services via HTTPS using the ArcGIS Silverlight API Thanks for your support.
... View more
07-15-2014
07:38 AM
|
0
|
0
|
555
|
POST
|
Server Side Rendering using vitual output directory works just fine for all browser except the Internet Explorer 9. For some reason the IE9 does try to get the picture from the virtual output directory. The following html gives us headache using the IE9. Upgrading to IE10 would do the job, although we cannot ask the customers to do so. Any light into this problem is greatly appreciated!!! <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=9, IE=10"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>IE Issue</title> <link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dojox/form/resources/RangeSlider.css"> <link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } h3 { margin: 0 0 5px 0; border-bottom: 1px solid #444; text-align: center } .shadow { -moz-box-shadow: 0 0 5px #888; -webkit-box-shadow: 0 0 5px #888; box-shadow: 0 0 5px #888; } #map{ margin: 0; padding: 0; } #feedback { background: #fff; color: #444; position: absolute; font-family: arial; height: 210px; left: 30px; margin: 5px; padding: 10px; bottom: 30px; width: 320px; z-index: 40; } .note { font-size: 80%; padding: 0 0 10px 0; } #slider { color: #666; margin: 5px auto; padding: 3px; } #appSliderLabel { padding: 0 0 10px 0; } #maxLabel { display: inline-block; margin: 0 0 0 -30px;} #minLabel { display: inline-block; margin: 0 0 0 30px;} #breakInfo { padding: 20px 0 0 0; } </style> <script>var dojoConfig = { parseOnLoad: true };</script> <script src="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script> <script> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.form.HorizontalRuleLabels"); dojo.require("dojox.form.RangeSlider"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.renderer"); dojo.require("esri.dijit.Legend"); // one global for persistent app variables var app = {}; var map; var highlightSymbol; var highlightGraphic; var mapClickEventHandle; var mode = 2; var companynetwork = 1; function init() { var lods = [ { "level": 3, "resolution": 19567.87924099992, "scale": 7.3957190948944E7 }, { "level": 4, "resolution": 9783.93962049996, "scale": 3.6978595474472E7 }, { "level": 5, "resolution": 4891.96981024998, "scale": 1.8489297737236E7 }, { "level": 6, "resolution": 2445.98490512499, "scale": 9244648.868618 }, { "level": 7, "resolution": 1222.992452562495, "scale": 4622324.434309 }, { "level": 8, "resolution": 611.4962262813797, "scale": 2311162.217155 } ]; map = new esri.Map("map", { extent: new esri.geometry.Extent({ "xmin": -2810436, "ymin": 3960049, "xmax": 17853544, "ymax": 20832657, "spatialReference": { "wkid": 102100} }), center: [7.07, 51.2], zoom: 0, lods: lods }); map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("https://www.comfone.com/arcgis/rest/services/basemap_basic/MapServer")); var defaultSymbol = new esri.symbol.SimpleFillSymbol().setStyle(esri.symbol.SimpleFillSymbol.STYLE_NULL); defaultSymbol.outline.setStyle(esri.symbol.SimpleLineSymbol.STYLE_NULL); var renderer = new esri.renderer.UniqueValueRenderer(defaultSymbol, "iso_a3", ""); renderer.addValue('USA', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('CAN', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('DEU', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('ITA', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('CHE', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); var worldCountriesLayer = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.comfone.com/arcgis/rest/services/country_outline/MapServer", { outFields: ["iso_a3"] }); var optionsArray = []; var drawingOptions = new esri.layers.LayerDrawingOptions(); drawingOptions.renderer = renderer; optionsArray[0] = drawingOptions; worldCountriesLayer.setLayerDrawingOptions(optionsArray); map.addLayer(worldCountriesLayer); var labelingLayer = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.comfone.com/arcgis/rest/services/label/MapServer", {"opacity":1.0}); labelingLayer.id = "labelingLayer"; map.addLayer(labelingLayer); } dojo.ready(init); </script> </head> <div id="map" class="claro" style="width: auto; height: 900px; border: 1px solid #000; margin-left: 5px; margin-right: 5px; position: relative;"> </div> </body>
... View more
07-31-2013
07:00 AM
|
0
|
0
|
571
|
POST
|
I took that over (here internally) and it implemented it as you said and it worked out fine. Thanks a lot! The issue that remains is that it does not work with the Internet Explorer (with all the other browsers it works properly). When I compare the tracing from the browsers I can see that when it works the browsers sends a request to https://www.comfone.com/arcgis/rest/services/country_outline/MapServer/export? (with is responded by the arcgisoutput directory from the server). But I couldn't find the same request using Internet Explorer. Did I miss something in my script that is required for IE, but not for the other browsers? Thanks! <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=9, IE=10"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>IE Issue</title> <link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dojox/form/resources/RangeSlider.css"> <link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } h3 { margin: 0 0 5px 0; border-bottom: 1px solid #444; text-align: center } .shadow { -moz-box-shadow: 0 0 5px #888; -webkit-box-shadow: 0 0 5px #888; box-shadow: 0 0 5px #888; } #map{ margin: 0; padding: 0; } #feedback { background: #fff; color: #444; position: absolute; font-family: arial; height: 210px; left: 30px; margin: 5px; padding: 10px; bottom: 30px; width: 320px; z-index: 40; } .note { font-size: 80%; padding: 0 0 10px 0; } #slider { color: #666; margin: 5px auto; padding: 3px; } #appSliderLabel { padding: 0 0 10px 0; } #maxLabel { display: inline-block; margin: 0 0 0 -30px;} #minLabel { display: inline-block; margin: 0 0 0 30px;} #breakInfo { padding: 20px 0 0 0; } </style> <script>var dojoConfig = { parseOnLoad: true };</script> <script src="https://serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script> <script> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.form.HorizontalRuleLabels"); dojo.require("dojox.form.RangeSlider"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.renderer"); dojo.require("esri.dijit.Legend"); // one global for persistent app variables var app = {}; var map; var highlightSymbol; var highlightGraphic; var mapClickEventHandle; var mode = 2; var companynetwork = 1; function init() { var lods = [ { "level": 3, "resolution": 19567.87924099992, "scale": 7.3957190948944E7 }, { "level": 4, "resolution": 9783.93962049996, "scale": 3.6978595474472E7 }, { "level": 5, "resolution": 4891.96981024998, "scale": 1.8489297737236E7 }, { "level": 6, "resolution": 2445.98490512499, "scale": 9244648.868618 }, { "level": 7, "resolution": 1222.992452562495, "scale": 4622324.434309 }, { "level": 8, "resolution": 611.4962262813797, "scale": 2311162.217155 } ]; map = new esri.Map("map", { extent: new esri.geometry.Extent({ "xmin": -2810436, "ymin": 3960049, "xmax": 17853544, "ymax": 20832657, "spatialReference": { "wkid": 102100} }), center: [7.07, 51.2], zoom: 0, lods: lods }); map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("https://www.comfone.com/arcgis/rest/services/basemap_basic/MapServer")); var defaultSymbol = new esri.symbol.SimpleFillSymbol().setStyle(esri.symbol.SimpleFillSymbol.STYLE_NULL); defaultSymbol.outline.setStyle(esri.symbol.SimpleLineSymbol.STYLE_NULL); var renderer = new esri.renderer.UniqueValueRenderer(defaultSymbol, "iso_a3", ""); renderer.addValue('USA', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('CAN', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('DEU', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('ITA', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); renderer.addValue('CHE', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#DC001B'))); var worldCountriesLayer = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.comfone.com/arcgis/rest/services/country_outline/MapServer", { outFields: ["iso_a3"] }); var optionsArray = []; var drawingOptions = new esri.layers.LayerDrawingOptions(); drawingOptions.renderer = renderer; optionsArray[0] = drawingOptions; worldCountriesLayer.setLayerDrawingOptions(optionsArray); map.addLayer(worldCountriesLayer); var labelingLayer = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.comfone.com/arcgis/rest/services/label/MapServer", {"opacity":1.0}); labelingLayer.id = "labelingLayer"; map.addLayer(labelingLayer); } dojo.ready(init); </script> </head> <div id="map" class="claro" style="width: auto; height: 900px; border: 1px solid #000; margin-left: 5px; margin-right: 5px; position: relative;"> </div> </body>
... View more
07-17-2013
06:55 AM
|
0
|
0
|
268
|
POST
|
Thanks for testing and replying! I will try to create a virtual output directory using ArcCatalog to tackle this problem as stated in the thread.
... View more
05-15-2013
10:59 PM
|
0
|
0
|
268
|
POST
|
Since feature layer will always lay on top of ArcGISDynamicMapServiceLayers, I tried to do the country coloring on the server side. It works just fine for three countries, once I specify four or more countries to the UniqueValueRenderer it fails. The rendering works fine until a fourth country is added to the UniqueValueRenderer. Any light into this mistery is most appreciated! Regards, Jörg <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title></title> <link rel="stylesheet" type="text/css" href="https://www.comfone.com/map/arcgis_js_api/library/3.2/jsapi/js/dojo/dijit/themes/claro/claro.css" /> <link rel="stylesheet" type="text/css" href="https://www.comfone.com/map/arcgis_js_api/library/3.2/jsapi/js/esri/css/esri.css" /> <!--<script type="text/javascript" src="https://www.comfone.com/map/arcgis_js_api/library/3.2/jsapi/init.js"></script>--> <!-- <script>var dojoConfig = { parseOnLoad: true };</script>--> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"></script> <script> dojo.require("dojo.dnd.Source"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.form.Button"); dojo.require("esri.map"); var map; // one global for persistent app variables var app = {}; function init() { alert("Only three countries can be added to the renderer. The server side rendering fails when more are added"); map = new esri.Map("map", { extent: new esri.geometry.Extent({ "xmin": -2810436, "ymin": 3960049, "xmax": 4233999, "ymax": 7917653, "spatialReference": { "wkid": 102100} }) }); map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("https://www.comfone.com/arcgis/rest/services/basemap_key2roam_platform/MapServer")); var defaultSymbol = new esri.symbol.SimpleFillSymbol().setStyle(esri.symbol.SimpleFillSymbol.STYLE_NULL); defaultSymbol.outline.setStyle(esri.symbol.SimpleLineSymbol.STYLE_NULL); var renderer = new esri.renderer.UniqueValueRenderer(defaultSymbol, "iso_a3", ""); renderer.addValue('CZE', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#71BF00'))); renderer.addValue('DEU', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#71BF00'))); renderer.addValue('FRA', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#71BF00'))); //only three countries can be added to the renderer. The server side rendering fails when more are added. // renderer.addValue('USA', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#71BF00'))); // renderer.addValue('CHE', new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color('#71BF00'))); var worldCountriesLayer = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.comfone.com/arcgis/rest/services/world_countries_detailed/MapServer", { outFields: ["iso_a3"] }); map.addLayer(worldCountriesLayer); var optionsArray = []; var drawingOptions = new esri.layers.LayerDrawingOptions(); drawingOptions.renderer = renderer; optionsArray[0] = drawingOptions; worldCountriesLayer.setLayerDrawingOptions(optionsArray); var labelingLayer = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.comfone.com/arcgis/rest/services/world_countries_labeling/MapServer", {"opacity":1.0}); labelingLayer.id = "labelingLayer"; map.addLayer(labelingLayer); } dojo.ready(init); </script> </head> <body class="tundra"> <div id="map" class="claro" style="width: auto; height: 900px; border: 1px solid #000; margin-left: 5px; margin-right: 5px; position: relative;"> </div> </body> </html>
... View more
05-14-2013
10:53 PM
|
0
|
3
|
422
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|