POST
|
Hi Sowmya, Have a look at this link Using Hyperlinks. Hab
... View more
02-12-2015
12:43 AM
|
0
|
0
|
212
|
POST
|
Hi Asghar, See if this can help. GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; graphicsLayer.ClearGraphics(); Hab
... View more
02-10-2015
03:12 AM
|
0
|
1
|
191
|
POST
|
Hi Priya, Can you post the code that you are using by changing your server name (for example to myserver)? Hab
... View more
02-09-2015
03:23 PM
|
0
|
0
|
265
|
POST
|
Hi Javier, Is the field type of "SIMBOLO" short integer? If the answer is yes, then yes it is possible. Here is a useful link Creating Subtypes and attribute Domains. Hab
... View more
02-09-2015
03:15 PM
|
0
|
0
|
257
|
POST
|
Hi Randy, Have you tried to batch add fields by right clicking the Add Field Tool in the Data Management Tools>Fields Toolset?
... View more
02-09-2015
07:14 AM
|
0
|
9
|
2667
|
POST
|
I have changed the codes similar to the one below (please note I have changed the name of my server to "myserver") and it printed a PDF like the image below, but I want to print only the image area not the text information.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Simple Map</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<script src="http://js.arcgis.com/3.11/"></script>
<script>
require(["esri/map", "esri/tasks/PrintTask", "dijit/form/Button", "dijit/form/CheckBox", "dijit/form/ComboBox"],
function(Map, PrintTask, Button, CheckBox, ComboBox) {
var layer, map, visible = [];
var printTask, params;
function init() {
var startExtent = new esri.geometry.Extent({"xmin":-2260000,"ymin":-1500000,"xmax":2250000,"ymax":1220000,"spatialReference":{"wkid":102008}});
map = new esri.Map("map", {extent:startExtent});
var dynUrl = "http://myserver:6080/arcgis/rest/services/USA/ConterminousUSA/MapServer";
layer = new esri.layers.ArcGISDynamicMapServiceLayer(dynUrl, { "id": "ConterminousUSA" });
if (layer.loaded) {
buildLayerList(layer);
}
else {
dojo.connect(layer, "onLoad", buildLayerList);
}
var printUrl = "http://myserver:6080/arcgis/rest/services/USA/AdvancedHighQualityPrinting/GPServer/AdvancedHighQualityPrinting";
printTask = new esri.tasks.PrintTask(printUrl, {async: true});
params = new esri.tasks.PrintParameters();
params.map = map;
}
function buildLayerList(layer) {
var items = dojo.map(layer.layerInfos,function(info,index){
if (info.defaultVisibility) {
visible.push(info.id);
}
return "<input type='checkbox' class='list_item' checked='" + (info.defaultVisibility ? "checked" : "") + "' id='" + info.id + "' onclick='updateLayerVisibility();' /><label for='" + info.id + "'>" + info.name + "</label>";
});
dojo.byId("layer_list").innerHTML = items.join();
layer.setVisibleLayers(visible);
map.addLayer(layer);
}
function updateLayerVisibility() {
var inputs = dojo.query(".list_item"), input;
visible = [];
dojo.forEach(inputs,function(input){
if (input.checked) {
visible.push(input.id);
}
});
//if there aren't any layers visible set the array to be -1
if(visible.length === 0){
visible.push(-1);
}
layer.setVisibleLayers(visible);
}
function print(){
var layout = dojo.byId("layout");
var index = layout.selectedIndex;
var selectedValue_layout = layout.options[index].value;
var format = dojo.byId("format");
var index = format.selectedIndex;
var selectedValue_format = format.options[index].value;
var georef_info = dojo.byId("georef_info");
var index = georef_info.selectedIndex;
var selectedValue_georef_info = georef_info.options[index].value;
var legendLayer = new esri.tasks.LegendLayer();
legendLayer.layerId = "ConterminousUSA";
legendLayer.subLayerIds = [];
if (CapitalCities.checked == true)
{
legendLayer.subLayerIds.push(0);
}
if (InterstateHighways.checked == true)
{
legendLayer.subLayerIds.push(1);
}
if (Rivers.checked == true)
{
legendLayer.subLayerIds.push(2);
}
if (Lakes.checked == true)
{
legendLayer.subLayerIds.push(3);
}
if (StateBoundaries.checked == true)
{
legendLayer.subLayerIds.push(4);
}
params.template = {layout: selectedValue_layout, format: selectedValue_format, layoutOptions: {legendLayers:[legendLayer]}};
params.extraParameters = {Georef_info: selectedValue_georef_info};
printTask.execute(params, printComplete);
}
function printComplete(result){
window.open(result.url);
}
dojo.addOnLoad(init);
});
</script>
</head>
<body class="claro">
<div id="map" style="width:1000px; height:600px; border:1px solid #000;"></div>
<br />
Layout Template:
<select id="layout" >
<OPTION value="CentralUSA">CentralUSA</OPTION>
<OPTION value="ConterminuousUSA">ConterminuousUSA</OPTION>
<OPTION value="NortheasternUSA">NortheasternUSA</OPTION>
<OPTION value="NorthwesternUSA">NorthwesternUSA</OPTION>
<OPTION value="SouthernUSA">SouthernUSA</OPTION>
<OPTION value="SouthwesternUSA">SouthwesternUSA</OPTION>
</select>
Format:
<select id="format">
<OPTION value="PDF">PDF</OPTION>
<OPTION value="PNG">PNG</OPTION>
</select>
Include Georef info?
<select id="georef_info">
<OPTION value="True">True</OPTION>
<OPTION value="False">False</OPTION>
</select>
<br /><br />
Table of Contents: <br /><span id="layer_list"></span>
<br /><br />
Include in Legend: <br />
<label><input type="checkbox" name="CapitalCities" checked="checked">Capital Cities</label>
<label><input type="checkbox" name="InterstateHighways" checked="checked">Interstate Highways</label>
<label><input type="checkbox" name="Rivers" checked="checked">Rivers</label>
<label><input type="checkbox" name="Lakes" checked="checked">Lakes</label>
<label><input type="checkbox" name="StateBoundaries" checked="checked">State Boundaries</label>
<br /><br />
<input type="button" id="print" value="Print" onclick="print();"/>
</body>
</html>
... View more
10-24-2014
03:19 AM
|
0
|
5
|
800
|
POST
|
Hi All, I have followed the step-by-step instructions of the ( Tutorial: Advanced web map printing/exporting using arcpy.mapping ) tutorial in ArcGIS Resources and it all works well. I have tested the geoprocessing service in ArcMap using a GIS server connection to my ArcGIS for Server and it works well. I copied and pasted the ArcGIS API for JavaScript code to the sandbox and changed the URLs of the map service and geoprocessing service to my server and run it. The results show that everything displayed well, however when I clicked on the print button it doesn't print anything. I know the HTML version used in this example is HTML 4.01 and JavaScript API version is 3.0. Can anyone please help me fix the print problem and change the code to the current version of JavaScript API 11 (or 10) and HTML 5? Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/js/dojo/dijit/themes/claro/claro.css">
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/"></script>
<script type="text/javascript" language="Javascript">
dojo.require("esri.map");
dojo.require("esri.tasks.PrintTask");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.ComboBox");
var layer, map, visible = [];
var printTask, params;
function init() {
var startExtent = new esri.geometry.Extent({"xmin":-2260000,"ymin":-1500000,"xmax":2250000,"ymax":1220000,"spatialReference":{"wkid":102008}});
map = new esri.Map("map", {extent:startExtent});
var dynUrl = "http://myserver:6080/arcgis/rest/services/USA/ConterminousUSA/MapServer";
layer = new esri.layers.ArcGISDynamicMapServiceLayer(dynUrl, { "id": "ConterminousUSA" });
if (layer.loaded) {
buildLayerList(layer);
}
else {
dojo.connect(layer, "onLoad", buildLayerList);
}
var printUrl = "http://myserver:6080/arcgis/rest/services/USA/AdvancedHighQualityPrinting/GPServer/AdvancedHighQualityPrinting";
printTask = new esri.tasks.PrintTask(printUrl, {async: true});
params = new esri.tasks.PrintParameters();
params.map = map;
}
function buildLayerList(layer) {
var items = dojo.map(layer.layerInfos,function(info,index){
if (info.defaultVisibility) {
visible.push(info.id);
}
return "<input type='checkbox' class='list_item' checked='" + (info.defaultVisibility ? "checked" : "") + "' id='" + info.id + "' onclick='updateLayerVisibility();' /><label for='" + info.id + "'>" + info.name + "</label>";
});
dojo.byId("layer_list").innerHTML = items.join();
layer.setVisibleLayers(visible);
map.addLayer(layer);
}
function updateLayerVisibility() {
var inputs = dojo.query(".list_item"), input;
visible = [];
dojo.forEach(inputs,function(input){
if (input.checked) {
visible.push(input.id);
}
});
//if there aren't any layers visible set the array to be -1
if(visible.length === 0){
visible.push(-1);
}
layer.setVisibleLayers(visible);
}
function print(){
var layout = dojo.byId("layout");
var index = layout.selectedIndex;
var selectedValue_layout = layout.options[index].value;
var format = dojo.byId("format");
var index = format.selectedIndex;
var selectedValue_format = format.options[index].value;
var georef_info = dojo.byId("georef_info");
var index = georef_info.selectedIndex;
var selectedValue_georef_info = georef_info.options[index].value;
var legendLayer = new esri.tasks.LegendLayer();
legendLayer.layerId = "ConterminousUSA";
legendLayer.subLayerIds = [];
if (CapitalCities.checked == true)
{
legendLayer.subLayerIds.push(0);
}
if (InterstateHighways.checked == true)
{
legendLayer.subLayerIds.push(1);
}
if (Rivers.checked == true)
{
legendLayer.subLayerIds.push(2);
}
if (Lakes.checked == true)
{
legendLayer.subLayerIds.push(3);
}
if (StateBoundaries.checked == true)
{
legendLayer.subLayerIds.push(4);
}
params.template = {layout: selectedValue_layout, format: selectedValue_format, layoutOptions: {legendLayers:[legendLayer]}};
params.extraParameters = {Georef_info: selectedValue_georef_info};
printTask.execute(params, printComplete);
}
function printComplete(result){
window.open(result.url);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="map" style="width:1000px; height:600px; border:1px solid #000;"></div>
<br />
Layout Template:
<select id="layout" >
<OPTION value="CentralUSA">CentralUSA</OPTION>
<OPTION value="ConterminuousUSA">ConterminuousUSA</OPTION>
<OPTION value="NortheasternUSA">NortheasternUSA</OPTION>
<OPTION value="NorthwesternUSA">NorthwesternUSA</OPTION>
<OPTION value="SouthernUSA">SouthernUSA</OPTION>
<OPTION value="SouthwesternUSA">SouthwesternUSA</OPTION>
</select>
Format:
<select id="format">
<OPTION value="PDF">PDF</OPTION>
<OPTION value="PNG">PNG</OPTION>
</select>
Include Georef info?
<select id="georef_info">
<OPTION value="True">True</OPTION>
<OPTION value="False">False</OPTION>
</select>
<br /><br />
Table of Contents: <br /><span id="layer_list"></span>
<br /><br />
Include in Legend: <br />
<label><input type="checkbox" name="CapitalCities" checked="checked">Capital Cities</label>
<label><input type="checkbox" name="InterstateHighways" checked="checked">Interstate Highways</label>
<label><input type="checkbox" name="Rivers" checked="checked">Rivers</label>
<label><input type="checkbox" name="Lakes" checked="checked">Lakes</label>
<label><input type="checkbox" name="StateBoundaries" checked="checked">State Boundaries</label>
<br /><br />
<input type="button" id="print" value="Print" onclick="print();"/>
</body>
</html>
... View more
10-24-2014
02:53 AM
|
1
|
6
|
2960
|
POST
|
Thanks Ken. I'm a bit confused, would you please show me using the attached example? Thanks
... View more
10-17-2014
06:19 AM
|
0
|
2
|
933
|
POST
|
Hi All, I can select features using point, extent, circle and freehand polygon. When I do buffer (e.g. 5 mile radius), I want the selection to include the features inside the buffer zone (at the moment it only selects features in side the polygon). The second issue is when I use the point button to select features it is selecting the polygon features but not the point features (I think I'm supposed to use tolerance but I don't know how). Here is a link to the jsfiddle. Thanks
... View more
10-17-2014
03:00 AM
|
0
|
4
|
1434
|
POST
|
Thanks Tim, The answer to my first question works perfect. However, I'm a bit confused with the answer to my second question. Would you please show me how and where to put the if function? Thanks
... View more
10-16-2014
06:06 AM
|
0
|
0
|
1674
|
Title | Kudos | Posted |
---|---|---|
1 | 11-20-2015 05:34 AM | |
1 | 09-04-2014 08:17 AM | |
3 | 02-12-2015 03:45 AM | |
1 | 10-16-2014 02:24 AM | |
1 | 10-24-2014 02:53 AM |
Online Status |
Offline
|
Date Last Visited |
a month ago
|