|
POST
|
That worked! (I guess the answer was that easy!) Although the symbols look a little funny ... Am I better off trying to change (or overwrite) the symbology on the JavaScript end rather than the desktop end? Screen shot: [ATTACH=CONFIG]13491[/ATTACH] It looks like your symbols are picture marker symbols that are jpgs (or not true transparent pngs). I would fix the symbol in desktop, instead of overriding in the api. Would you mind marking my response as an answer? thanks.
... View more
04-13-2012
07:10 AM
|
0
|
0
|
1554
|
|
POST
|
after you changed the mxd and msd and restarted the service, did you clear the rest cache?
... View more
04-13-2012
05:58 AM
|
0
|
0
|
1554
|
|
POST
|
Sounds like an enhancement request for Esri. We'd need a boolean property for "will display at the current scale". This should apply to featureLayers and tiledMapServiceLayers, and for each layer of a dynamicMapServiceLayer. Cheers, Steve I think its each layer of a tiled as well. Need to know why its not showing in the tile!
... View more
04-13-2012
05:40 AM
|
0
|
0
|
1597
|
|
POST
|
It's my understanding that ${B_Number} is not a recognized variable... how do I grab ${B_Name} and set it to a javascript variable after the query? SOrry, was trying to rush. Here is the real code. I: 1. moved the infoTemplate into the for loop (changed to a dojo forEach) 2. Created a blank content variable 3. Queried on the field from the featureset (trimmed it first in case it was empty, not null) 4. Appended the Field value onto the content variable only if it existed 5. set the infotemplate to the Title and content variable. <!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" /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>UCSB Interactive Campus Map</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type='text/css' href='http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/esri/dijit/css/Popup.css'/> <style type="text/css"> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } </style> <script type="text/javascript"> var djConfig = { parseOnLoad: true }; </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script> <script type="text/javascript"> dojo.require("dijit.dijit"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.dijit.Popup"); var map; function init() { initExtent = new esri.geometry.Extent({ "xmin":-119.86100, "ymin":34.40856, "xmax":-119.83553, "ymax":34.41913, "spatialReference":{"wkid":4326} }); var popup = new esri.dijit.Popup(null, dojo.create("div")); map = new esri.Map("map", { infoWindow: popup }); //Add the topographic layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://ags2.geog.ucsb.edu/ArcGIS/rest/services/icmBaseMap20120411/MapServer"); map.addLayer(basemap); //Add Building Layer var layerCampusBuildings = new esri.layers.ArcGISDynamicMapServiceLayer("http://ags2.geog.ucsb.edu/ArcGIS/rest/services/Buildings_120404/MapServer"); map.addLayer(layerCampusBuildings); //*********************************** //START Buildings Popup/Highlight Code function executeQueryTask(evt) { //onClick event returns the evt point where the user clicked on the map. //This is contains the mapPoint (esri.geometry.point) and the screenPoint (pixel xy where the user clicked). //set query geometry = to evt.mapPoint Geometry query.geometry = evt.mapPoint; //Execute task and call showResults on completion queryTask.execute(query, showResults); } function showResults(featureSet) { //remove all graphics on the maps graphics layer map.graphics.clear(); //QueryTask returns a featureSet. Loop through features in the featureSet and add them to the map. dojo.forEach(featureSet.features, dojo.hitch (this, function(f) { //Get the current feature from the featureSet. //Feature is a graphic var graphic = f; graphic.setSymbol(symbol); var content = ""; if(dojo.trim(f.attributes["B_Number"])!=""&&dojo.trim(f.attributes["B_Number"])!=null){ content+="<b>Bldg:</b>"+ f.attributes["B_Number"]+"<br />"; } if(dojo.trim(f.attributes["Department"])!=""&&dojo.trim(f.attributes["Department"])!=null){ content+="<b>Department:</b>"+ f.attributes["Department"]; } infoTemplate = new esri.InfoTemplate(f.attributes["B_Name"]+"<br />",content); //Set the infoTemplate. graphic.setInfoTemplate(infoTemplate); //Add graphic to the map graphics layer. map.graphics.add(graphic); })); } //Listen for click event on the map, when the user clicks on the map call executeQueryTask function. dojo.connect(map, "onMouseMove", executeQueryTask); dojo.connect(map, "onClick", executeQueryTask); //build query task queryTask = new esri.tasks.QueryTask("http://earth.geog.ucsb.edu/ArcGIS/rest/services/icmBasemap10/MapServer/16"); //Can listen for onComplete event to process results or can use the callback option in the queryTask.execute method. //dojo.connect(queryTask, "onComplete", showResults); //build query filter query = new esri.tasks.Query(); query.returnGeometry = true; query.outFields = ["B_Name", "B_Number", "Department"]; symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([25,25,112]), 3), new dojo.Color([0,0,128,1])); //END BUILDINGS POPUP/HIGHLIGHT CODE //*********************************** dojo.connect(map, "onLoad", function(map) { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map,map.resize); }); } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div id="mainWindow" dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width:100%; height:100%;"> <div id="header" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="top"> <span> This is the header section </span> </div> <div id="leftPane" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="left" style="width:275px;"> This is the left section </div> <div id="centerPane" dojotype="dijit.layout.BorderContainer" class="roundedCorners" region="center" gutters="false"> <div id="map" dojotype="dijit.layout.ContentPane" class="shadow" region="center" style="position:relative; overflow:hidden;"> <div id="ovWin" class="shadow" style="position:absolute; right:35px; top:5px; z-Index:998; width:100px;height:100px; "> <div id="overviewDiv" style="width:100%;height:100%;"> </div> </div> </div> <div id="footer" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="bottom"> This is the footer section </div> </div> </div> </body> </html>
... View more
04-13-2012
05:02 AM
|
0
|
0
|
2572
|
|
POST
|
That makes sense. I don't remember this being the case a few months back. Why would the "bestview" return values that don't best represent the "bestview" of the spatial feature being requested. I suppose using the the returned location point would be an option? Any other options? no idea, you could try setExtent(...extent.bestview, true) to force the entire extent into the view.
... View more
04-12-2012
11:19 AM
|
0
|
0
|
1412
|
|
POST
|
Nice map in your code //create the infoTemplate to be used in the infoWindow.
//All ${attributeName} will be substituted with the attribute value for current feature.
infoTemplate = new esri.InfoTemplate("${B_Name}<br />", "<b>Bldg:</b> ${B_Number}<br /><b>Department:</b> ${Department}");
i would change it to
var content = "";
if(${B_Number}){
content+="<b>Bldg:</b>"+ ${B_Number}+"<br />";
}
if(${Department}){
content+="<b>Department:</b>"+ ${Department};
}
infoTemplate = new esri.InfoTemplate("${B_Name}<br />",content);
}
... View more
04-12-2012
10:32 AM
|
0
|
0
|
2572
|
|
POST
|
If you include the aleutian islands, Alaska crosses the international dateline, so 170 is most likely correct. I working on an application that uses the Bing Geocoder to return the best extent for a state and zoom to that location. I'm finding an issue with the state of Alaska. All of the other states return the correct spatial extent in the 'bestView' property. Here is the code I have: veGeocoder3.addressToLocations(where);//*** 'where' = 'AK' or 'Alaska'
function(geocodeResults) {
if(geocodeResults.length == 0){
alert("No address results returned.");
}else if(searchType == 'Address' && radius != ''){
var location = geocodeResults[0].location;
var pointMeters = esri.geometry.geographicToWebMercator(location);
var pointSymbol = new esri.symbol.SimpleMarkerSymbol().setSize(10).setColor(new dojo.Color("black"));
var locationGraphic = new esri.Graphic(pointMeters,pointSymbol);
var level = radiuszoom[radius];
addResults.add(locationGraphic);
var buffDist = radius;
doBuffer(buffDist,pointMeters);
map.centerAndZoom(pointMeters,level);
}else{
map.setExtent(esri.geometry.geographicToWebMercator(geocodeResults[0].bestView));
}
}); Looking at the extent of the returned information I see the xmin value is missing a negative. Has anyone experienced this same situation? Any suggestions on a solution? I would still like to stick with the Bing Geocoder instead of publishing a state layer for searching. Thanks!
... View more
04-12-2012
09:33 AM
|
0
|
0
|
1412
|
|
POST
|
The Identity Manager API ref documents esri.id: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/identitymanager.htm awesome thank you, thats what i get for only looking in identitymanagerbase and not realizing that identitymanager extends it. Thanks again
... View more
04-12-2012
07:27 AM
|
0
|
0
|
1622
|
|
POST
|
This is one of the reasons we manually create our popups. However, that is a bit excessive in this case. Can you post the code you use to set your infowindow/popup content? In very pseudo code
var content = getContent(); //get json content from whereever you are getting it
//loop through json
for (var key in p) {
//remove nulls
if (p[key]==null){
delete p.key;
}
}
//set content
infoWindow.setContent(content);
... View more
04-12-2012
07:24 AM
|
0
|
0
|
2572
|
|
POST
|
Sorry you havent gotten much response, periodic/occasional bugs like this are the hardest to track down. My guess is that you may be capping out your maximum instances on your services. Have you looked at the number of running instances versus the maximum instances in arccatalog when you hit the web service? I would try upping the number of maximum instances and seeing if the problem improves.
... View more
04-12-2012
06:56 AM
|
0
|
0
|
1183
|
|
POST
|
It has just dawned on me the gaping security hole of allowing someone (maybe even the public) to upload a file (picture, pdf, etc.. ) directly into the database using an edit widget. Is any file validation/virus scanning occuring? or do I need to do that in my app. And if I do need to do it, how do I intercept the upload? Anyone have any ideas on this?
... View more
04-12-2012
06:37 AM
|
0
|
1
|
818
|
|
POST
|
Paul yes getting the map scale you use that method, its getting the Layer (and sublayer) visibilities that is, well, difficult. For example: Current Map scale 1:10000 1 Dynamic Layer with 3 sublayers (a,b,c) a - visible all the time b - turns on at 1:15000 c - turns on at 1:5000 Most of us would prefer this displayed ArcMAP style where the group (1) indicates some layers arent drawing so: 1 (symbolize some not drawing) - a - (symbolize as visible) - b - (symbolize as checked and visible, but would turn off if you zoom out) - c - (symbolize as checked, but not visible due to scale) unfortunately to get the info about the sublayers you need to make a separate query to the MapService to get the layer properties. You also either need to store this info (per layer) and check it when the scale changes (onzoomin, onzoomout) or you need to make queries everytime.
... View more
04-12-2012
05:14 AM
|
0
|
0
|
1597
|
|
POST
|
Is there a way to determine whether a layer is switched on, but is not currently shown due to the scale threshold? See the attached file for an example. When the map first loads, the counties layer is "on" but is not shown due to the map scale. Zoom in a level and and the counties appear. How can I determine this programmatically? featureLayer.visible returns "true" at all scales. featureLayer.onVisibilityChange doesn't fire when the scale threshold is crossed. The workaround is to check the current map scale (by finding the LOD and figuring out the corresponding scale?) and compare it to the layer's minScale and maxScale. This seems like a clumsy workaround - is it the only option? Thanks, Steve This clumsy workaround is the only one I could come up with as well, due to the exact limitation you listed. When i layer loads, i check the min/max of all the component layers of the service. We had people complain about not being able to see greyed out text, so we color coded green for visibile, yellow for partially visible (some sublayers on, some off) and red for hidden due to scale dependencies. http://www.mymanatee.org/gisapps/mapviewer/ You can see in our "Live Maps" TOC widget the color coded scale icons. We also incorporated legend thumbnails.
... View more
04-12-2012
04:50 AM
|
0
|
0
|
1597
|
|
POST
|
Yes I am good, for now, mostly. OF course I am nervous that at 2.9 (and changing to dojo 1.7+) alot of these workarounds will need tweaking, and my biggest concern is the lack of documentation on them. For example, in the work around, we do esri.id.registerServers([serverInfo]); but where is esri.id documented? I am guessing based on the registerServers command that it is related to esri.IdentityManagerBase, but i never created an "id" object, so how am i setting it?
... View more
04-12-2012
04:39 AM
|
0
|
0
|
2060
|
|
POST
|
I got this fixed, i think i got bitten by the asynchronous nature of javascript. For some reason at 2.6 it worked fine, changing to 2.7 or 2.8 cause a variable i was using to be called before it was set, but only when i used the identitymanager. Trapping for undefined/null allows me to proceed without the error. sorry for the false alarm, i am still baffled as to what changed.
... View more
04-11-2012
01:05 PM
|
0
|
0
|
2060
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-22-2014 08:35 AM | |
| 1 | 05-02-2012 04:56 AM | |
| 1 | 10-29-2021 07:40 AM | |
| 1 | 10-28-2021 05:26 AM | |
| 1 | 07-17-2012 08:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-01-2022
02:00 PM
|