|
POST
|
Maybe I'm missing something obvious, but I have an existing web map and I want to change the url for a map layer that's already been added. How do I do this? I don't want to delete the "old" layer and add the "new" layer because I have customized the layer in the web map. Can anyone enlighten me? Thanks, Joan
... View more
08-02-2013
11:50 AM
|
0
|
2
|
947
|
|
POST
|
Jeff -- You rock! That worked great and I never would have figured it out myself. So thanks so much for the response.
... View more
07-12-2013
08:19 AM
|
0
|
0
|
906
|
|
POST
|
I have downloaded the Basic Viewer Template and used it as the basis for a custom app. I have found that holding down the Shift key and drag a box on the map to zoom in does not work in IE. It works if I'm using Firefox or Chrome. Here's the link for my app: http://gis.tpcmaps.org/apps/staging/rezoning/ Can anyone shed light on why it's not working in IE? Thanks, Joan
... View more
07-12-2013
07:42 AM
|
0
|
3
|
3658
|
|
POST
|
I have downloaded the Basic Viewer template. I am creating my webmap with code. I'm trying to create a function that will return an array of fields I can use in the 'fieldInfos' setting of the 'popupInfo', so I don't have to hardcode them. Here's the code for my operational layer: //Existing Land Use (popup)
{ "url": "http://gis.tpcmaps.org/ArcGIS/rest/services/LandUse/Existing_Land_Use/MapServer/0",
"visibility": true,
"opacity": 0,
"mode": 2, //Selection-only
//"visibleLayers": [],
"layerDefinition": {
"minScale": 100000,
"maxScale": 0,
},
"title": "popup Existing Land Use",
"id": "popelu",
"popupInfo": {
"title": "Existing Land Use",
"fieldInfos": createFieldInfos(), Using the following function works as expected, so I know the approach is do-able. function createFieldInfos() {
console.log("-->inside createFieldInfos function");
var thearray = [{'fieldName': 'JURISDICTION','label': 'JURISDICTION','visible':true},{'fieldName': 'ELUSHADE','label': 'EXISTING LU','visible':true},{'fieldName': 'ELU2_DESC','label': 'ELU DESCRIPTION','visible':true},];
return thearray;
} But when I try returning the array in this function, it's not working. function createFieldInfos() {
console.log("-->inside createFieldInfos function");
var endpoint = "http://gis.tpcmaps.org/ArcGIS/rest/services/LandUse/Existing_Land_Use/MapServer/0";
//esri.request returns a deferred.
var jsonobject = esri.request({
url: endpoint,
content: { f: 'json' },
callbackParamName: 'callback',
//load: processServiceInfo, //The load property specifies a function that will execute once the content has been successfully downloaded.
//error: errorHandler
});
//If the json object is successfully returned, get the fields from the layer.
jsonobject.then(
function (info) {
console.log('layer info: ', info);
console.log("info.name: " + info.name + ",info.id: " + info.id);
var fieldInfos = "[";
dojo.forEach(info.fields, function(field) {
console.log( "Name: " + field.name + ", Alias: " + field.alias);
if (field.name != "Shape" & field.name != "OBJECTID") {
fieldInfos += "{'fieldName': '" + field.name + "',";
fieldInfos += "'label': '" + field.alias + "',";
fieldInfos += "'visible':" + true + "},";
}
});
fieldInfos += "]";
console.log("fieldInfos: " + fieldInfos);
//convert the string into an array.
fieldInfosArray = eval(fieldInfos);
console.log("fieldInfosArray.length: " + fieldInfosArray.length);
return fieldInfosArray;
},
function (error) {
console.log("Error: ", error.message);
}
);
return jsonobject;
} I suspect it's some scoping issue?
... View more
06-20-2013
11:22 AM
|
0
|
1
|
572
|
|
POST
|
a. While printing can we display overview map on print layout ? My users also want the overview map on the print page. Is that do-able somehow via a custom template? b. Can we display symbologies of features presented in tile services ? See this post - I think it addresses your question. http://forums.arcgis.com/threads/86925-Legends-for-Tiled-map-services-don-t-display-in-Print-output
... View more
06-20-2013
06:39 AM
|
0
|
0
|
338
|
|
POST
|
I would love to -- but how do I do that? Sorry, the obvious things evade me sometimes...
... View more
06-19-2013
12:17 PM
|
0
|
0
|
2308
|
|
POST
|
Thanks for leading me in the right direction. To avoid hardcoding the layer ids for the legend, I've created a global variable 'legendLayers' that gets set in the buildLayerVisibleList function. var legendLayers = []; //use the same filtered list created in the 'buildLayerVisibleList' function in the legend dijit, added 5/23/13 jms
function buildLayerVisibleList(layers) {
console.log("--> inside buildLayerVisibleList");
var layerInfos = [];
dojo.forEach(layers, function (mapLayer, index) {
console.log("mapLayer.title: " + mapLayer.title + ", mapLayer.id: " + mapLayer.id);
//If layer is for viewing popup info only, do not add to layer list. added 5/23/13 jms.
//The id of the layer must start with 'pop' to filter it out.
var isPopupLyr = false;
if (mapLayer.id.substring(0,3) == "pop") { isPopupLyr = true} ;
console.log("isPopupLyr: " + isPopupLyr);
//Only include layers that are not used solely for 'popups', added 5/23/13 jms
if (isPopupLyr == false) {
if (mapLayer.featureCollection && !mapLayer.layerObject) {
if (mapLayer.featureCollection.layers) {
//add the first layer in the layer collection... not all - when we turn off the layers we'll
//turn them all off
if (mapLayer.featureCollection.layers) {
layerInfos.push({
"layer": mapLayer,
"visible": mapLayer.visibility,
"title": mapLayer.title
});
}
}
} else if (mapLayer.layerObject) {
layerInfos.push({
layer: mapLayer.layerObject,
visible: mapLayer.layerObject.visible,
title: mapLayer.title
});
}
}
});
legendLayers = layerInfos; //set global var for use with the legend dijit, added 5/23/13 jms
return layerInfos;
}
I use the 'legendLayers' global variable in the addPrint function to create the list of layer ids for the legend. function addPrint() {
console.log("--> inside addPrint function");
//legendLayers global var set in the buildLayerVisibleList fn.
//Array contains layer object, visible setting, and title.
console.log("legendLayers.length: " + legendLayers.length);
//Create array containing the layer objects ids.
var layerIds = [];
//Loop thru each layer object and push id into the new array.
for (var i = 0; i < legendLayers.length; i++) {
//var layer = layers;
console.log("legendLayers.layer.id: " + legendLayers.layer.id);
var legendLyr = new esri.tasks.LegendLayer();
legendLyr.layerId = legendLayers.layer.id
layerIds.push(legendLyr);
}
console.log("layerIds.length: " + layerIds.length);
var layoutOptions = {
'authorText': configOptions.owner,
'titleText': configOptions.title,
'scalebarUnit': (i18n.viewer.main.scaleBarUnits === 'english') ? 'Miles' : 'Kilometers',
//'legendLayers': [] //comment out so the legend will display by default, 6/13/13 jms. But this won't print the legend for tiled services...
//'legendLayers': [legendLayer]
'legendLayers': layerIds //set to the layer id array
};
//TODO - replace default templates with info from service
var templates = dojo.map(configOptions.printlayouts, function (layout) {
layout.layoutOptions = layoutOptions;
return layout;
});
// print dijit
var printer = new esri.dijit.Print({
map: map,
templates: templates,
url: configOptions.helperServices.printTask.url
}, dojo.create('span'));
dojo.query('.esriPrint').addClass('esriPrint');
dojo.byId('webmap-toolbar-center').appendChild(printer.printDomNode);
printer.startup();
} In the function 'initUI', I had to move the call to 'addPrint' below the call to 'addLayerList' (which calls 'buildLayerVisibleList') so the global variable was set before addPrint needed it. This approach works, though I have found the following legend print limitations which I'll need to address: Space allotted for the legend in the out-of-the-box templates is too small Layers in the legend don't display the layer's title. Note: In case you're wondering, in the buildLayerVisibleList function, I'm filtering out any map layer that I've added solely for popup functionality, because I have added their corresponding map service so the labels display. Kind of a pain that individual layers won't display labels...
... View more
06-19-2013
10:36 AM
|
0
|
0
|
2308
|
|
POST
|
I have downloaded the Basic Viewer template. I am creating my webmap with code (partial listing below). webmap.itemData = { "operationalLayers": [ //Developable Land (display tiled service) { "url": "http://gis.tpcmaps.org/ArcGIS/rest/services/LandUse/Developable_Land/MapServer", "visibility": false, "opacity": 1, //"visibleLayers": [], //"minScale": 100000, //"maxScale": 0, "title": "Developable Land", "id": "devland", "description": null }, //Community-Based Planning Area (display dynamic map service) { "url": "http://gis.tpcmaps.org/ArcGIS/rest/services/Websites/tpcCPA/MapServer", "visibility": false, "opacity": 0.6, //"visibleLayers": [], //"minScale": 100000, //"maxScale": 0, "title": "Community-Based Planning Areas", "id": "cpa", "description": null }, I have added several operational layers (dynamic and tiled map services hosted on my server). All are being displayed in the map and legend as expected. The problem is that when I print, the legend for the tiled map services are not being displayed on the print output. I have tested with a single tiled layer with only 1 legend entry, so I know it's not a matter of the legend getting cut off. The tiled service is displayed on the map of the printed output as expected. Here's the addPrint function from the Basic Viewer. I commented out the 'legendLayers' setting so the legend will display. function addPrint() { var layoutOptions = { 'authorText': configOptions.owner, 'titleText': configOptions.title, 'scalebarUnit': (i18n.viewer.main.scaleBarUnits === 'english') ? 'Miles' : 'Kilometers', //'legendLayers': [] //comment out so the legend will display by default, 6/13/13 jms. }; //TODO - replace default templates with info from service var templates = dojo.map(configOptions.printlayouts, function (layout) { layout.layoutOptions = layoutOptions; return layout; }); // print dijit var printer = new esri.dijit.Print({ map: map, templates: templates, url: configOptions.helperServices.printTask.url }, dojo.create('span')); dojo.query('.esriPrint').addClass('esriPrint'); dojo.byId('webmap-toolbar-center').appendChild(printer.printDomNode); printer.startup(); } Any idea why legends for tiled map services do not print? I am using the ESRI print service, though I wouldn't think that would make a difference. Thanks, Joan
... View more
06-18-2013
12:27 PM
|
1
|
8
|
5275
|
|
POST
|
I've added that line but unfortunately it's still not working. Any other ideas?
... View more
05-31-2013
11:27 AM
|
0
|
0
|
1587
|
|
POST
|
I have the following code working, but I need to return the value of the resultant "fieldInfos" string to the createFieldInfos() function and I'm not sure how to do that. Can anyone point me in the right direction? Thanks, Joan function createFieldInfos() {
console.log("-->inside createFieldInfos function");
var endpoint = "http://gis.tpcmaps.org/ArcGIS/rest/services/LandUse/Existing_Land_Use/MapServer/0";
var jsonobject = esri.request({
url: endpoint,
content: { f: 'json' },
callbackParamName: 'callback',
load: processServiceInfo,
error: errorHandler
});
console.log("jsonobject: " + jsonobject);
}
function processServiceInfo(info) {
console.log('layer info: ', info);
console.log("info.name: " + info.name + ",info.id: " + info.id);
var fieldInfos = "";
fieldInfos += "[";
dojo.forEach(info.fields, function(field) {
console.log( "Name: " + field.name + ", Alias: " + field.alias);
if (field.name != "Shape" & field.name != "OBJECTID") {
fieldInfos += "{'fieldName': '" + field.name + "',";
fieldInfos += "'label': '" + field.alias + "',";
fieldInfos += "'visible':" + true + "},";
}
});
fieldInfos += "],";
console.log("fieldInfos: " + fieldInfos);
}
function errorHandler(err) {
console.log('error: ', err);
}
... View more
05-31-2013
10:58 AM
|
0
|
5
|
5739
|
|
POST
|
I'm using the basic viewer template but creating the webmap via json (not ArcGIS online). The popup infoWindow works great, but as you navigate the features the window itself hides the outline for part of the feature. I've attached an image so you can see what I mean. Is there any way to make the "leader line" (not sure if that's the proper name for it) longer so this doesn't happen? Where and how do you control it? Thanks, Joan
... View more
05-31-2013
07:38 AM
|
0
|
4
|
1094
|
|
POST
|
I'm using the basic viewer template but creating the webmap via json (not ArcGIS online). I noticed that to get the pop-up to work, you have to use the individual layer and not a map service. But the individual layer doesn't show the labels that have been set. On the other hand, if you use a map service, it will display the labels but then the pop-up doesn't work. Is this expected behavior? What's the best approach if you want both pop-ups and labels? Thanks, Joan
... View more
05-22-2013
01:13 PM
|
0
|
0
|
1912
|
|
POST
|
Hi, I'm using the basic viewer template but creating the webmap via json (not ArcGIS online). I'm trying to set the minScale for a specific layer so it doesn't draw until you zoom in. My code is below, but the layer is still drawing at full extent. Is there something I'm missing? Thanks, Joan {
"url": "http://gis.tpcmaps.org/ArcGIS/rest/services/LandUse/Existing_Land_Use/MapServer/0",
"visibility": false,
"opacity": 0.75,
"minScale": 2400,
"maxScale": 0,
"title": "Existing Land Use",
"id": "elu",
"popupInfo": {
"title": "Existing Land Use",
"fieldInfos": [
{
"fieldName": "ObjectID",
"label": "ObjectID",
"isEditable": false,
"tooltip": "",
"visible": true,
"stringFieldOption": "textbox"
},
{
"fieldName": "Shape",
"label": "Shape",
"isEditable": false,
"tooltip": "",
"visible": false,
"stringFieldOption": "textbox"
},
{
"fieldName": "JURISDICTION",
"label": "Jurisdiction",
"isEditable": false,
"tooltip": "",
"visible": true,
"stringFieldOption": "textbox"
},
{
"fieldName": "ELUSHADE",
"label": "Existing LU",
"isEditable": false,
"tooltip": "",
"visible": true,
"stringFieldOption": "textbox"
},
{
"fieldName": "ELU2_DESC",
"label": "Description",
"isEditable": false,
"tooltip": "",
"visible": true,
"stringFieldOption": "textbox"
}
],
"description": null,
}
... View more
05-22-2013
01:11 PM
|
0
|
0
|
643
|
|
POST
|
Finally got this to work - CSS (or lack thereof) was the culprit! Data was written to the grid, you just couldn't see it because I hadn't specified the width/height of the dialog box and results div. Added the following classes to the elements and styles in the css file. Thanks to all who responded, I appreciate your time. css .gridDialog {width:680px;height:420px}
.gridResults {width:650px;height:300px} html <div dojoType="dijit.Dialog" id="paresultsDialog" class="gridDialog" title="Plan Amendment Results" data-dojo-props="draggable:false">
<div id="parowcountdisplay"></div><br \>
<div>Click on column heading to sort the list.<br />Click on a row(s) to zoom to the plan amendment area(s) on the map.</div>
<div id="paresults" class="panel_content, gridResults" dojoType="dijit.layout.ContentPane" >
<table data-dojo-type="dojox.grid.EnhancedGrid" data-dojo-id="gridpa" id="gridpa" data-dojo-props="rowsPerPage:'10', rowSelector:'5px', selectionMode:'single', plugins:{exporter:true}">
<thead>
<tr>
<th width="75px" field="OBJECTID">Result Id</th>
<th width="100px" field="JURISDICTION">Jurisdiction</th>
<th width="150px" field="NAME">Plan Amendment</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
... View more
05-16-2013
11:03 AM
|
0
|
0
|
937
|
|
POST
|
gridpa.set("store", store); Unfortunately that did not work either.
... View more
05-15-2013
12:48 PM
|
0
|
0
|
937
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 02-12-2024 07:28 PM | |
| 2 | 04-04-2013 06:54 AM | |
| 1 | 04-09-2013 11:27 AM | |
| 2 | 12-03-2014 08:04 AM | |
| 1 | 05-09-2013 12:45 PM |
| Online Status |
Offline
|
| Date Last Visited |
02-13-2024
03:46 AM
|