POST
|
Any solution to this yet? On my own site (jsapi 3.7), changing scalebarUnit from Miles to Feet only changes the unit text- what was 0.5 miles now reads 0.5 feet. What I'd like to do is display in feet when zoomed in and miles when zoomed out by passing a variable to scalebarUnit. Thanks.
... View more
05-04-2015
07:45 AM
|
2
|
1
|
626
|
POST
|
That did it - I misunderstood what outSpatialReference did. Thanks guys!
... View more
06-12-2013
07:25 AM
|
0
|
0
|
579
|
POST
|
I was already setting the outSpatialReference when I was seeing the problem. It's set to 102100 to match the web map. Are you saying it should be set to match the spatial reference of the dataframe in the template mxd?
... View more
06-12-2013
07:00 AM
|
0
|
0
|
579
|
POST
|
To remove the scalebar, do I have to create a custom mxd to use as a template? Thanks
... View more
06-11-2013
08:22 AM
|
0
|
0
|
1148
|
POST
|
The basemap is the World_Topo_Map, so the spatial reference is 102100 (3857).
... View more
06-11-2013
07:56 AM
|
0
|
0
|
1148
|
POST
|
Setting width and height in the export options had no effect. Here's the print function I'm currently using:
function printPDF() {
var printUrl = 'http://services.kgs.ku.edu/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task';
var printTask = new esri.tasks.PrintTask(printUrl);
var params = new esri.tasks.PrintParameters();
var template = new esri.tasks.PrintTemplate();
template.layout = layout; // layout set elsewhere
template.format = "PDF";
template.preserveScale = true;
template.showAttribution = false;
template.layoutOptions = {
scaleBarUnit: "Miles",
titleText: title, // title set elsewhere
legendLayers: []
};
params.map = app.map;
params.outSpatialReference = sr; // sr set elsewhere to 102100, also tried setting it to 3857
params.template = template;
printTask.execute(params, printResult, printError);
}
I don't expect it to be exact - I know our section lines aren't exactly a mile apart. But this seems way off. At a scale of about 1:72000, 2 miles on the scale bar is only about 1.5 miles on the map. Has anyone else noticed something like this? Can any ESRI folks comment? Thanks, Mike
... View more
06-11-2013
05:53 AM
|
0
|
0
|
1148
|
POST
|
Hello, I'm using the print task in v3.5 to output a pdf. The scalebar on the pdf is not accurate however, it's about 0.3 miles short when compared to section lines on the map (see attached pdf). I'm using the preserveScale = true option. I have the scalebar units set to miles, and have experimented with setting the units of the basemap as well - nothing makes an improvement. Any thoughts? Thanks
... View more
06-10-2013
07:52 AM
|
0
|
16
|
3723
|
POST
|
The basemap is a little fuzzier than I'd like (for example, the "Pawnee River" text in the attached pdf). Just wondering if there's anything that can be done to improve it or if this is the norm. Thanks, Mike
... View more
06-07-2013
06:01 AM
|
0
|
0
|
326
|
POST
|
Hello all, I've been working with the tutorial on basic high quality printing which uses a subset of the World Topo basemap in vector format. My questions are: Is the whole dataset available somewhere in vector format for high quality printing? Are any of the ESRI basemaps available for this kind of use, or will I have to come up with my own basemap? Thanks, Mike
... View more
06-06-2013
06:36 AM
|
0
|
3
|
1220
|
POST
|
Hello, I'm trying to modify this sample to incorporate my own oil and gas fields layer. I'm having two problems: 1) the fields don't display when the map is first loaded, but will display after I've selected an attribute. 2) after selecting an attribute for rendering, the layer displays with the default symbology - not rendered by the selected attribute. (if the renderer was working it would be displayed using the light yellow to green gradient of the sample code) Some details: - the fields service is 10.1, dynamic-enabled - JSapi v3.4 - SDE-based layer with about 7500 features The test application can be viewed at http://maps.kgs.ku.edu/test/renderertest.html . The oil fields are located in Kansas. Complete code is below. Any thoughts appreciated, Mike
<!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" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/tundra/tundra.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; }
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;
bottom: 30px;
color: #444;
position: absolute;
font-family: arial;
height: 400px;
left: 30px;
margin: 5px;
padding: 10px;
top: 30px;
width: 300px;
z-index: 40;
}
#note { font-size: 80%; font-weight: 700; padding: 0 0 10px 0; }
#loading { visibility: hidden; }
#legendDiv { padding: 10px 0 0 0; }
</style>
<script>var dojoConfig = { parseOnLoad: true };</script>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"></script>
<script>
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dijit.form.FilteringSelect");
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.tasks.GenerateRendererTask");
dojo.require("esri.dijit.Legend");
var app = {};
function init() {
var ext;
esri.config.defaults.io.proxyUrl = 'http://maps.kgs.ku.edu/proxy.jsp';
app.dataUrl = "http://services.kgs.ku.edu/arcgis/rest/services/oilgas/oilgas_fields/MapServer/0"; //dynamic enabled, 10.1 service
app.defaultFrom = "#ffffcc";
app.defaultTo = "#006837";
app.map = new esri.Map("map", {
center: [-85.787, 39.782],
zoom: 6,
slider: false,
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer");
app.map.addLayer(basemap);
var ref = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer");
app.map.addLayer(ref);
// add og fields as a dynamic map service layer
urlDyn = "http://services.kgs.ku.edu/arcgis/rest/services/oilgas/oilgas_fields/MapServer";
fieldsLayer = new esri.layers.ArcGISDynamicMapServiceLayer(urlDyn, {
id: "og_fields",
opacity: 0.7,
visible: false
});
app.map.addLayer(fieldsLayer);
}
function classBreaks(attr) {
console.log(attr);
var c1 = app.defaultFrom;
var c2 = app.defaultTo;
var classDef = new esri.tasks.ClassBreaksDefinition();
classDef.classificationField = attr;
classDef.classificationMethod = "natural-breaks";
classDef.breakCount = 5;
var colorRamp = new esri.tasks.AlgorithmicColorRamp();
colorRamp.fromColor = new dojo.colorFromHex(c1);
colorRamp.toColor = new dojo.colorFromHex(c2);
colorRamp.algorithm = "hsv";
classDef.baseSymbol = new esri.symbol.SimpleFillSymbol("solid", null, null);
classDef.colorRamp = colorRamp;
var params = new esri.tasks.GenerateRendererParameters();
params.classificationDefinition = classDef;
var generateRenderer = new esri.tasks.GenerateRendererTask(app.dataUrl);
generateRenderer.execute(params, applyRenderer, errorHandler);
}
function applyRenderer(renderer) {
dijit.byId('fieldsdialog').hide();
var optionsArray = [];
var drawingOptions = new esri.layers.LayerDrawingOptions();
drawingOptions.renderer = renderer;
optionsArray[2] = drawingOptions;
app.map.getLayer("og_fields").setLayerDrawingOptions(optionsArray);
app.map.getLayer("og_fields").show();
if ( ! app.hasOwnProperty("legend") ) {
//createLegend(); //removed for test
}
}
function createLegend() {
app.legend = new esri.dijit.Legend({
map : app.map,
layerInfos : [ {
layer : app.map.getLayer("og_fields"),
title : "Oil and Gas Fields"
} ]
}, dojo.byId("legendDiv"));
app.legend.startup();
}
function errorHandler(err) {
console.log("error: ", dojo.toJson(err));
}
dojo.ready(init);
</script>
</head>
<body class="tundra">
<div dojoType="dijit.Dialog" id="fieldsdialog" title="Filter Fields" style="text-align:center;font:normal normal bold 14px arial">
<div style="text-align:left;font:normal normal normal 12px arial">
Select attribute to map:
<select name="fieldattribute" id="fieldattr">
<option value="CUMM_OIL">Cummulative Oil</option>
<option value="cumm_gas">Cummulative Gas</option> <!--trying both upper and lower case values-->
<option value="AVGDEPTHSL">Average Depth (sea level)</option>
</select>
<input type="button" onClick="classBreaks(dojo.byId('fieldattr').value)" value="Go">
</div>
</div>
<div data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit.layout.ContentPane"
data-dojo-props="region:'center'">
<div id="feedback" class="shadow">
<h3>Change the Attribute Field Used to Render Data</h3>
<div id="info">
<div id="note">
Note: This sample requires an ArcGIS Server version 10.1 map service to generate a renderer.
</div>
<button onClick="dijit.byId('fieldsdialog').show();">Select Attribute</button>
<img id="loading" src="http://dl.dropbox.com/u/2654618/loading_black.gif" />
<div id="legendDiv"></div>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
05-15-2013
09:07 AM
|
0
|
1
|
679
|
POST
|
I'm getting the same error message when trying to make a request directly from the REST endpoint, so no proxy involved, right? Get the error even when I'm remoted in to the machine where Server resides. Any thoughts appreciated. Mike
... View more
02-12-2013
08:03 AM
|
0
|
0
|
406
|
POST
|
Hello, I'm using a layer definition to display only a subset of features. When I then click on a point to identify it however, it frequently brings up a nearby 'invisible' feature - one that was excluded by the layer definition. I've read this thread: http://forums.arcgis.com/threads/39250-Identify-Task-identifys-also-invisble-features-(LayerDefinition) but am still having no luck. Anybody have an example of applying the identifyparams.layerdefinitions that is more complete than the reference snippet? Or another method of identifying only visible features? Thanks
... View more
12-02-2011
09:57 AM
|
0
|
3
|
688
|
POST
|
Hello, I'm trying to draw a line on the map using the addPath method. Here's the code snippet (using v1.6):
var line = new esri.geometry.Polyline(new esri.SpatialReference( {wkid:102100} ));
var path = new Array();
for (i=0; i<xPoints.length; i++)
{
coords = '[' + xPoints + ',' + yPoints + ']';
path.push(coords);
}
alert(path);
line.addPath(path);
alert(line.paths);
The first alert shows the path formatted like this: [-10993319,4632566],[-10907471,4612961] which seems correct to me. However, the second alert (after the path is added to the polyline) only shows 3 commas (,,,) so the path doesn't get added and the line doesn't draw. Any ideas appreciated. Mike
... View more
07-23-2010
06:47 AM
|
0
|
3
|
3432
|
POST
|
Derek - that worked beautifully! Thank you very much. Mike
... View more
07-15-2010
05:31 AM
|
0
|
0
|
732
|
Title | Kudos | Posted |
---|---|---|
2 | 05-04-2015 07:45 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|