POST
|
Chris, I just wanted to follow up with you and once again thank you for your help. Your example helped me see what I was NOT doing correctly. So, thanks for taking the time to help me out .. it is very much appreciated. thx. David
... View more
02-23-2015
12:57 PM
|
1
|
1
|
1020
|
POST
|
hmmm .... your code worked with my map services and print service. cool! Well, I guess I will use your stuff on this. I am not sure why the ESRI example code is not working with it, but whatever. thx Chris!
... View more
02-19-2015
07:46 AM
|
1
|
2
|
1020
|
POST
|
I could really use a hand on this. If someone could give me a hand, I would totally appreciate it. When I run the print task and watch it in Fiddler, I get this:: # Result Protocol Host URL Body Caching Content-Type Process Comments Custom 2 304 HTTP www.currymap.org /arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task?f=json 0 private, must-revalidate, max-age=0 chrome:888 This is the error I am getting: --> it means nothing to me except that it keeps pointing back to the Geoprocessor.js file. Could this be a permissions or config issue? Uncaught TypeError: Cannot read property 'query' of undefined Geoprocessor.js?1424320198202:14 m.execute init.js:717 y._createWrappers.n.forEach.b.(anonymous function) PrintTask.js?1424320198202:9 s.execute Print.js?1424320198202:7 f.printMap Print.js?1424320198202:8 (anonymous function) init.js:177 g.hitch_ MenuBase.js?1424320198202:8 k.onItemClick_ MenuBase.js?1424320198202:4 (anonymous function) init.js:220 (anonymous function)
... View more
02-18-2015
08:35 PM
|
0
|
0
|
1020
|
POST
|
Hello, I am trying to wire up some print functionality on an app that I am building. I basically just copied the code from the JSAPI samples page ... just to get a sense of how it works, When I click on the "Print" button, it heads off like the samples do, but I get the following error: js.arcgis.com/3.12/esri/tasks/Geoprocessor.js?1424148233374:14 Uncaught TypeError: Cannot read property 'query' of undefined I am not sure how to resolve this, it is the first time I have used the 10.2 print task. I have also tried to publish my own templates as a print task and that is getting the same error. Could someone point me in the right direction on this? thx David Code is below: doPrint: function() { console.log("In the startup for print!"); //esriConfig.defaults.io.alwaysUseProxy = false; //esriConfig.defaults.io.proxyUrl = ""; // get print templates from the export web map task var printInfo = esriRequest({ "url": this.printUrl, "content": { "f": "json" } }); printInfo.then(this.handlePrintInfo, this.handleError); }, handlePrintInfo: function (resp) { var layoutTemplate, templateNames, mapOnlyIndex, templates; layoutTemplate = arrayUtils.filter(resp.parameters, function (param, idx) { return param.name === "Layout_Template"; }); if (layoutTemplate.length === 0) { console.log("print service parameters name for templates must be \"Layout_Template\""); return; } templateNames = layoutTemplate[0].choiceList; // remove the MAP_ONLY template then add it to the end of the list of templates mapOnlyIndex = arrayUtils.indexOf(templateNames, "MAP_ONLY"); if (mapOnlyIndex > -1) { var mapOnly = templateNames.splice(mapOnlyIndex, mapOnlyIndex + 1)[0]; templateNames.push(mapOnly); } // create a print template for each choice templates = arrayUtils.map(templateNames, function (ch) { var plate = new PrintTemplate(); plate.layout = plate.label = ch; plate.preserveScale = true; plate.format = "PDF"; plate.layoutOptions = { "authorText": "Made by: Esri's JS API Team", "copyrightText": "<copyright info here>", "legendLayers": [], "titleText": "Pool Permits", "scalebarUnit": "Miles" }; return plate; }); // create the print dijit var printer = new Print({ "map": global.MAP, // ---> yes, I know <sigh!> "templates": templates, url: this.printUrl }, dom.byId("print_button")); try { printer.startup(); } catch (ex) { console.log(ex.message); } printer.on('print-start', function () { console.log('The print operation has started'); }); printer.on('print-complete', function (evt) { console.log('The url to the print image is : ' + evt.result.url); }); },
... View more
02-16-2015
08:58 PM
|
0
|
5
|
6536
|
POST
|
It seems maybe I have the wrong idea about this. Its probably easiest just to write them all as addins, then create toolbars in ArcMap for the tools folks want / need. Thanks anyways.
... View more
01-26-2015
02:46 PM
|
0
|
1
|
240
|
POST
|
I have seen some questions pertaining to this here and there, but I have yet to figure out if it is possible. This is what I want: I have a suite of ArcObjects (COM) tools that I am beginning to convert to Addins. However, I don't want to have all of the tools (there are a lot) in the same project or solution even. I want to be able to independently manage each project as an addin, then move the addin to my Addins directory. Then, I would like to create a toolbar which can load them all onto the toolbar. So, each tool would really be an independent tool/command within some ArcMap category, and I am merely organizing them onto a toolbar at some point in the ArcMap load process. I have seen the documentation on the AddIn.FromID<T> stuff, but I am not clear on how to create a tool/command in code on a toolbar which will invoke the tool/command. The benefits of Addins is what we are looking for --> the maintainability. Can someone tell if this is possible and if so, point me in the right direction.
... View more
01-22-2015
01:58 PM
|
0
|
2
|
4059
|
POST
|
thanks Alexey. nice to know at least something can be directly migrated. we had such pains when trying to use locators that were created in 9.3 in 10, guess the assumptions were flying about the tiles. thanks again.
... View more
10-04-2012
01:17 PM
|
0
|
0
|
282
|
POST
|
Is it possible to move our 10.0 caches to the new 10.1 services that we are going to have to recreate? Parenthetically: It is extremely frustrating that ESRI has once again devised a new reason for us to completely uninstall one of its products in order to re-install its new product. For those of us who have small shops and a heavy reliance on ArcGIS Server, it is a huge burden to have to stand down our current architecture in order to stand up a new one. I hope some day ESRI can figure out how to do "Upgrades", rather than complete system overhauls. I am basing my gripe on this, if I am wrong about the whole upgrade path, please let me know: http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000002p0000000 So, is it possible to use our caches from 10 with the recreated services that we need to create for 10.1, or is that something we will need to recreate as well? sigh ... david
... View more
10-04-2012
10:44 AM
|
0
|
2
|
400
|
POST
|
Does anyone know if there will be any map rotation capabilities in the JS API in 10.1? We have a use case which calls for a vehicle to be be moving towards the top of the screen, regardless of actual direction. Currently, we can use CSS to rotate div map element, but leads to wierdness with panning. We don't want to use Silverlight or Flex to do this, as JS API is more of a long term solution. Any thoughts? thanks david
... View more
04-25-2012
12:14 PM
|
0
|
1
|
2465
|
POST
|
very nice, guys! thanks for posting this! here is how i did it in C# protected override void OnClick()
{
CTargetLayer oCombo = (CTargetLayer)ESRI.ArcGIS.Desktop.AddIns.AddIn.FromID<CTargetLayer>(ThisAddIn.IDs.CTargetLayer);
oCombo.refreshLayers();
System.Windows.Forms.MessageBox.Show("Done");
}
... View more
09-06-2011
01:34 PM
|
0
|
0
|
499
|
POST
|
looks like a plain old QueryTask will work for what i need. i probably don't need the FeatureLayer in this scenario. thanks! david
... View more
04-21-2011
02:20 PM
|
0
|
0
|
705
|
POST
|
Kelly, Am trying to get the code back to how it was before i made it add the graphics. This is close to what it was. function Init() {
var iniExtent = new esri.geometry.Extent({"xmin": 4249987, "ymin": 238755, "xmax": 4315098, "ymax": 274866, "spatialReference":{"wkid":2270}});
map = new esri.Map("map", { extent:iniExtent,logo: false});
var layer = new esri.layers.ArcGISTiledMapServiceLayer(BaseMap);
map.addLayer(layer);
var streets = new esri.layers.ArcGISTiledMapServiceLayer(TransportationMap);
map.addLayer(streets);
dojo.connect(map, "onLoad", function() {
$.ajax(
{
url: "<%=System.Web.HttpContext.Current.Request.ApplicationPath.ToString() %>/Projects/GetProjectDates",
cache: false,
success: function (data) {
loadConstructionDates(data.ProjectDataTable);
}
});
});
}
function loadConstructionDates(constructionDates)
{
m_constructionProjectDates = constructionDates;
if (m_constructionProjectDates.length > 0) {
showConstructionProjects();
}
}
function showConstructionProjects()
{
var streetIds = "";
for (p in m_constructionProjectDates) {
var project = m_constructionProjectDates
;
if (streetIds.length < 1) {
streetIds = project.StreetIDNUM;
}
else
{
streetIds = streetIds + "," + project.StreetIDNUM;
}
}
var fieldsSelectionSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,255,0.95]), 2);
var service = '<%= System.Configuration.ConfigurationManager.AppSettings["StreetsFeatureService"].ToString() %>';
featureLayer = new esri.layers.FeatureLayer(service,
{
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"],
infoTemplate: infoTemplate
});
dojo.connect(featureLayer,"onMouseOut",mouseOutHandler);
featureLayer.setDefinitionExpression("IDNUM IN '" + streetIds + "'");
featureLayer.setSelectionSymbol(fieldsSelectionSymbol);
map.addLayer(featureLayer);
} When I run that code, I get this error in Firebug: Error: Unable to draw graphic (null): Unable to complete operation. if(!dojo._hasResource["dijit._base.man...h","tr","xx","zh","zh-cn","zh-tw"]); thanks david
... View more
04-21-2011
12:49 PM
|
0
|
0
|
705
|
POST
|
Kelly, That does not seem to be happening for me, unless I add the graphics. Do i need to be using a FeatureServer service? Or can i use a MapServer service as well? Either way, i am still having to add the graphics. The way I am doing this is: 1). I get the IDNums that I want to show from the $ajax function 2). When those results are returned I call the function to show them 3). I loop through the results and create a query, then call selectFeatures The only way those selected IDs are showing up is if i add them to a graphics layer. What am i doing wrong? thanks david
... View more
04-21-2011
12:30 PM
|
0
|
0
|
705
|
POST
|
well, it never fails ... whenever i am at my wits end and leave a post here on the forum, the mere act of forming the question helps me to solve my problem. so, i think i found a solution. i was not putting the graphics onto the map. the features were coming back, but i was not adding them to the graphics layer. if anyone has a better way of doing this, i would love to know, but below is what i came up with. thanks function showConstructionProjects() {
var fieldsSelectionSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color("#FF0000"), 4);
for (p in m_constructionProjectDates) {
var project = m_constructionProjectDates
;
if (project.StreetIDNUM.length > 0) {
var query = new esri.tasks.Query();
query.where = "IDNUM = " + project.StreetIDNUM;
featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {
for (var i = 0; i < features.length; i++) {
var graphic = features;
graphic.setSymbol(fieldsSelectionSymbol);
streetGraphicsLayer.add(graphic);
console.log("Got a graphic");
}
});
}
}
}
... View more
04-21-2011
09:06 AM
|
0
|
0
|
705
|
POST
|
i am trying to select a feature on a featureLayer by the IDNUM. it looks like the selection is happening, but the selection is not showing up on the map. can anyone tell me what might be going on here? thanks david function Init() {
$.ajax(
{
url: "<%=System.Web.HttpContext.Current.Request.ApplicationPath.ToString() %>/Projects/GetProjectDates",
cache: false,
success: function (data) {
loadConstructionDates(data.ProjectDataTable);
}
}
);
var iniExtent = new esri.geometry.Extent({"xmin": 4249987, "ymin": 238755, "xmax": 4315098, "ymax": 274866, "spatialReference":{"wkid":2270}});
map = new esri.Map("map", { extent:iniExtent,logo: false});
map.enableScrollWheelZoom();
var layer = new esri.layers.ArcGISTiledMapServiceLayer(BaseMap);
map.addLayer(layer);
var streets = new esri.layers.ArcGISTiledMapServiceLayer(TransportationMap);
map.addLayer(streets);
featureLayer = new esri.layers.FeatureLayer(FeatureMap, {
outFields: ["*"],
mode: esri.layers.FeatureLayer.MODE_SELECTION,
id: "streetsFeatureLayer"
});
var fieldsSelectionSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 255, 255, 0.95]), 2);
featureLayer.setSelectionSymbol(fieldsSelectionSymbol);
map.addLayer(featureLayer);
dojo.connect(featureLayer, "onSelectionComplete", selectionComplete);
}
function loadConstructionDates(constructionDates)
{
m_constructionProjectDates = constructionDates;
if (m_constructionProjectDates.length > 0) {
showConstructionProjects();
}
}
function showConstructionProjects() {
var streetIDs = "";
for (p in m_constructionProjectDates) {
var project = m_constructionProjectDates ;
if (project.StreetIDNUM.length > 0) {
var id = project.StreetIDNUM;
var query = new esri.tasks.Query();
query.where = "IDNUM = " + id;
featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW);
}
}
}
function selectionComplete()
{
console.log("This one is done");
}
... View more
04-21-2011
08:39 AM
|
0
|
7
|
1339
|
Title | Kudos | Posted |
---|---|---|
1 | 02-23-2015 12:57 PM | |
1 | 02-19-2015 07:46 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|