|
POST
|
Hi Chris, Yes, that's basically what I'm trying to ask. From Dave's 2nd comment above it sounds like the desktop SDKs won't install w/ VS 2010 express editions on the machine. We still haven't received 10.0 so I cannot confirm this, just trying to plan ahead. Thanks again to all, TG
... View more
08-27-2010
05:45 AM
|
0
|
0
|
1030
|
|
POST
|
Hi Chris, Yes, but if I need to do development for both server (specifically the Silverlight 2.0 api) and desktop apps will I need to uninstall web dev 2010 express, install the sdks and then re-install web dev 2010 and keep a copy of vs 2008 for the desktop work? And if so, any chance that SP1 will allow VS 2010 express? Thanks again, TG
... View more
08-26-2010
10:39 AM
|
0
|
0
|
1030
|
|
POST
|
If I'm reading this thread correctly, I cannot install any of the SDKs if I have Web Developer 2010 Express installed? Has anyone tried installing Web Dev or any of the other express versions after installing the SDKs? My concern is that in addition to developing add-ins for desktop, I also am working on a Silverlight application which requires some version of VS 2010 and we cannot afford to buy the full version. Any insight would be appreciated. Thanks, Terry
... View more
08-26-2010
09:13 AM
|
0
|
0
|
1030
|
|
POST
|
You could try using the DistanceAsynch method on the GeometryService. Only hard part is that it looks like it only takes a single geometry for both the input (your map click) and the target (in this case one of your polygons). You could query the polygon layer w/ the current map extent and then pass the geometry of each feature in the returned featureset to the Distance operation and simply keep track of the lowest distance and that features ID. But, if there are no features from the polygon layer currently in the extent, that won't work... you could add some logic that if no features are returned within the map extent to try again w/ a 25% larger extent and keep bumping that up until there's a least one feature returned from the spatial query.
... View more
08-20-2010
09:37 AM
|
0
|
0
|
1094
|
|
POST
|
For an example of moveable controls, check out the 'unblended' application template available from ArcGIS.com - http://www.arcgis.com/home/item.html?id=b77d416635a74e66ab222fe519af2eb7 The Boston site was done in Flex, but I would think you could add some animation to the controls in SL as well.
... View more
08-16-2010
10:10 AM
|
0
|
0
|
436
|
|
POST
|
I ended up building the listbox in the cod behind as the layers in our map are added at startup. I used Jennifer's method of binding to the layer's Id instead of index and it works great. There's probably a better way to set the margins and width of the controls, but it'll work for now. XAML
<Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<esri:Map x:Name="map" Grid.ColumnSpan="4" Grid.Row="1" IsLogoVisible="False" >
<esri:Map.Extent>
<esri:Envelope XMin="-130" YMin="10" XMax="-70" YMax="60" >
<esri:Envelope.SpatialReference>
<esri:SpatialReference WKID="4326"/>
</esri:Envelope.SpatialReference>
</esri:Envelope>
</esri:Map.Extent>
<esri:Map.Layers>
<!--layers added at runtime -->
</esri:Map.Layers>
</esri:Map>
<!--TOC-->
<Border Background="#996495ED" BorderThickness="1" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="20" Padding="5" BorderBrush="Black" Grid.Row="1" Grid.Column="0" >
<ListBox x:Name="MyList" ></ListBox>
</Border>
</Grid>
CS
void MapServicesLoadComplete(LoadOperation<Web.ApplicationMapServices> lo)
{
//Executes when the asynch domain service query completes; adds MapServices to the map
Layer layer;
ArcGISDynamicMapServiceLayer DynLayer = new ArcGISDynamicMapServiceLayer();
ArcGISTiledMapServiceLayer TileLayer = new ArcGISTiledMapServiceLayer();
foreach (var mapservice in lo.Entities)
{
if (mapservice.Cached == 1)
{
TileLayer = new ArcGISTiledMapServiceLayer();
TileLayer.Url = mapservice.ServerURL + "/" + mapservice.MapServiceName + "/MapServer";
TileLayer.ID = mapservice.MapServiceName;
layer = TileLayer;
}
else
{
DynLayer = new ArcGISDynamicMapServiceLayer();
DynLayer.Url = "http://" + mapservice.AGSServerName + "/arcgis/rest/services/" + mapservice.MapServiceName + "/MapServer";
DynLayer.ID = mapservice.MapServiceName;
layer = DynLayer;
}
layer.Opacity = mapservice.Transparancy == 0 ? 100 : 1- (Convert.ToDouble(mapservice.Transparancy)/100);
layer.Visible = Convert.ToBoolean(mapservice.Active);
map.Layers.Add(layer);
MyList.Items.Insert(0, BuildTOCitem(layer));
}
}
private StackPanel BuildTOCitem(Layer lyr)
{
StackPanel spNewItem = new StackPanel();
CheckBox cbx = new CheckBox();
Slider sldr = new Slider();
TextBlock tblock = new TextBlock();
spNewItem.Orientation = Orientation.Horizontal;
Binding bind = new Binding("Layers[" + lyr.ID + "].Visible");
bind.Mode = BindingMode.TwoWay;
bind.ElementName = "map";
cbx.SetBinding(CheckBox.IsCheckedProperty, bind);
bind = new Binding("Layers[" + lyr.ID + "].Opacity");
bind.Mode = BindingMode.TwoWay;
bind.ElementName = "map";
sldr.Margin = new Thickness(-5, 0, 0, 0);
sldr.Width = 50;
sldr.Minimum = 0;
sldr.Maximum = 1;
sldr.SetBinding(Slider.ValueProperty, bind);
bind = new Binding("Layers[" + lyr.ID + "].ID");
bind.Mode = BindingMode.OneWay;
bind.ElementName = "map";
tblock.Margin = new Thickness(5, 0, 0, 0);
tblock.SetBinding(TextBlock.TextProperty,bind);
spNewItem.Children.Add(cbx);
spNewItem.Children.Add(sldr);
spNewItem.Children.Add(tblock);
return spNewItem;
}
... View more
08-16-2010
06:29 AM
|
0
|
0
|
1374
|
|
POST
|
Try using System.Windows.Browser.HtmlDocument, it has a QueryString property that will return a dictionary of the parameters and values from the URL.
... View more
08-16-2010
06:10 AM
|
0
|
0
|
427
|
|
POST
|
Hello Dominique, Thanks for the reply. I tried again today, it works just fine..weird. I was not setting the image format for the dynamic layer in my XAML as the default is png24 which should support transparency. below is what I had in my XAML, guess my computer just needed a rest..
<esri:Map x:Name="map" Grid.ColumnSpan="4" Grid.Row="1">
<esri:Map.Extent>
<esri:Envelope XMin="-130" YMin="10" XMax="-70" YMax="60" >
<esri:Envelope.SpatialReference>
<esri:SpatialReference WKID="4326"/>
</esri:Envelope.SpatialReference>
</esri:Envelope>
</esri:Map.Extent>
<esri:Map.Layers>
<!-- imagery service in 4326 -->
<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/I3_Imagery_Prime_World_2D/MapServer"/>
<!-- local dynamic service in 4269 -->
<esri:ArcGISDynamicMapServiceLayer Url="http://myserver/ArcGIS/rest/services/test_service/MapServer/" />
</esri:Map.Layers>
</esri:Map>
... View more
08-13-2010
07:10 AM
|
0
|
0
|
426
|
|
POST
|
how can you reverse the order in the list and maintain the binding w/ the layer visibility and opacity? Would I need to create another control w/ 2 LayerCollections and (two way)bind one to the ListBox and the other actual map layers with some code to handle changes? Or am I over thinking this? Thanks, Terry
... View more
08-13-2010
06:01 AM
|
0
|
0
|
1374
|
|
POST
|
Based on the SL samples and my own experimenting, it appears dynamic layers can be projected on the fly to match that of the map it is displayed in. One thing I've noticed though is that if the dynamic layer's projection doesn't match, it gets a white background when projected to match the map covering all layers underneath. Is this correct and if so is it by design, a known limitation, or something I can work around? For now it's not a big issue as almost all of our map services match the old ArcGIS online schema of Geographic WGS 84, but when those are turned off and only the Web Mercator versions are available it looks like I'll have to modify all of our services to match... Thanks, Terry
... View more
08-12-2010
12:23 PM
|
0
|
2
|
655
|
|
POST
|
What kind of environment are you developing in? If you're using Visual Web Developer or something similar, can you put a break point in the code at s.push("</tbody></table>") and then execute s.join in the immediate window to see what s contains? Is it valid HTML? Another good debugging option is to use Firebug. Do you have firefox and the firebug extension installed on your machine? Try adding a few console.log() statements in the code to make sure the whole thing is running & to narrow down where the problem is. My question regarding if dojo.byId returning the correct DOM node - since the html you posted has 2 divs with the same ID, I'm wondering what dojo.byId returns - my guess would be either the 1st one it finds or an error but I'm not sure which... If the 1st for loop is working correctly and the sort is returning a valid array, then the problem might be in constructing the array s. There are a lot of embedded quotes and opening and closing tags, one of which could be missing & difficult to find. Instead of building the table as text, have you considered creating it using some of the DOM methods like createElement and appendChild and using CSS to apply all of the fonts and colors? Here's a small sample of how you could use that instead -
//make new row & cell to add layer info to
trow = document.createElement('tr');
tcell = document.createElement('td');
//apply alternating style to the row - rowodd and roweven are classes in a CSS file with different background colors so the table has alternating row colors
//NOTE - IE has issues w/ setting class have to work around by using non-standard className
//see http://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html
if (rowcount % 2 == 0) {
if (dojo.isIE) {trow.setAttribute("className","rowodd"); }
else { trow.setAttribute("class", "rowodd"); }
}
else {
if (dojo.isIE) { trow.setAttribute("className", "roweven"); }
else { trow.setAttribute("class", "roweven"); }
}
//use data from the featureset attributes to fill the innerHTML of the tcell here.....
//tcell.innerHTML = "name: " + attribs[NAME] ;
trow.appendChild(tcell);
//now append that row to a tablebody - in this case one that already exists..
dojo.byId('tblbody').appendChild(trow);
//example of inserting above the existing bottom row instead of appending..
//dojo.byId('tblbody').insertBefore(trow,dojo.byId('rowBtmRow'));
//increment rowstyle counter
rowcount += 1;
... View more
07-30-2010
08:29 AM
|
0
|
0
|
1028
|
|
POST
|
Is the sort working? After you call s.join(""), what's in s? Can you take the content of s at this poitn and copy/paste it in another blank html file & have it display? Does dojo.byId("tbl") return a valid DOM node?
... View more
07-30-2010
07:10 AM
|
0
|
0
|
1029
|
|
POST
|
You might try putting another for... loop above your existing one that builds a 2D array w/ the field you want to sort on in the 1st item and the full attributes of the associated feature in the second -
sortlist = [];
for (var i = 0, il = results.length; i < il; i++) {
result = results;
attribs = result.feature.attributes;
sortlist = new Array(2);
sortlist[0] = attribs.PIN; //which ever field you want to sort on
sortlist[1] = attribs;
}
sortlist.sort(numbersort);
//now run your existing for loop but at the top reset attribs = sortlist[1]
for (var i = 0, il = results.length; i < il; i++) {
attribs = sortlist[1];
if (attribs.Active === "N") {
s.push("<tr style=\"background-color:#F28282;\"><td nowrap><font size=2.5> " + attribs.Full_Address + "</font></td><td nowrap><font size=2.5>" + attribs.GIS_Key + "</font></td><td nowrap><font size=2.5>" + attribs.PIN + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Name + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Address + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_City + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_State + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_ZIP + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Date + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Update + "</font></td><td nowrap><font size=2.5>" + attribs.Occupant_Name + "</font></td><td nowrap><font size=2.5>" + attribs.Occ_Phone1 + "</font></td><td nowrap><font size=2.5>" + attribs.Occ_Phone2 + "</font></td><td nowrap><font size=2.5>" + attribs.Village + "</font></td><td nowrap><font size=2.5>" + attribs.Active + "</font></td></tr>");
}
else if (attribs.Village === "N") {
s.push("<tr style=\"background-color:#BDBDBD;\"><td nowrap><font size=2.5> " + attribs.Full_Address + "</font></td><td nowrap><font size=2.5>" + attribs.GIS_Key + "</font></td><td nowrap><font size=2.5>" + attribs.PIN + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Name + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Address + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_City + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_State + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_ZIP + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Date + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Update + "</font></td><td nowrap><font size=2.5>" + attribs.Occupant_Name + "</font></td><td nowrap><font size=2.5>" + attribs.Occ_Phone1 + "</font></td><td nowrap><font size=2.5>" + attribs.Occ_Phone2 + "</font></td><td nowrap><font size=2.5>" + attribs.Village + "</font></td><td nowrap><font size=2.5>" + attribs.Active + "</font></td></tr>");
}
else {
s.push("<tr><td nowrap><font size=2.5> " + attribs.Full_Address + "</font></td><td nowrap><font size=2.5>" + attribs.GIS_Key + "</font></td><td nowrap><font size=2.5>" + attribs.PIN + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Name + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Address + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_City + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_State + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_ZIP + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Date + "</font></td><td nowrap><font size=2.5>" + attribs.Owner_Update + "</font></td><td nowrap><font size=2.5>" + attribs.Occupant_Name + "</font></td><td nowrap><font size=2.5>" + attribs.Occ_Phone1 + "</font></td><td nowrap><font size=2.5>" + attribs.Occ_Phone2 + "</font></td><td nowrap><font size=2.5>" + attribs.Village + "</font></td><td nowrap><font size=2.5>" + attribs.Active + "</font></td></tr>");
}
}
Give it a try and let me know if it works for you. Also, you have 2 Divs in your body with the id of "tbl" and an extra </td> tag.
... View more
07-29-2010
05:45 AM
|
0
|
0
|
1029
|
|
POST
|
Javascript arrays have a sort() method that can be used to sort your data. You might need to do it before constructing the html table but should be helpful. See https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/sort for discussion on how it works. Below is some code I've used before to sort results from an Identify task within a table cell.
//inside of a switch statement looking at the layer name returned
case 'Subdivision':
tcell.innerHTML = "<span style='font-weight:bold'>Subdivision History (Name and Number, sorted most recent to oldest):</span>";
tcell.innerHTML += "<br> <span style='font-style:italic'>For reference only - not to be relied upon as a legal search of the property.</span><br>";
//need to loop thru all of the idResults that are sub history
//date, name, docname, annsubid
var featcount = 0;
while (idResults.layerName == 'Subdivision') {
featval = idResults.feature.attributes['SUBDATE'];
sortlist[featcount] = new Array(2);
sortlist[featcount][0] = new Date(featval).valueOf(); //get date in ms for sorting
sortlist[featcount][1] = "<a href='http://myserver/" + idResults.feature.attributes['LINK'] + "' target='_blank'>" + idResults.feature.attributes['NAME'] + " (" + idResults.feature.attributes['ID'] + ")</a><br>";
featcount += 1;
}
//sort descending
sortlist.sort(numbersort);
for (var z = 0, iz = featcount; z < iz; z++) {
tcell.innerHTML += sortlist [1];
}
break;
//after the switch statement...add the cell to a table row and add that to the table above an existing row
trow.appendChild(tcell);
dojo.byId('tblbody').insertBefore(trow,dojo.byId('rowSummary'));
// here's the basic function I used to sort numbers. note it's taking in arrays
function numbersort(a, b) {
//sort the 1st element in 2 arrays descending
//used to sort subs, agreements, PUD docs, etc...
return b[0] - a[0];
}
... View more
07-27-2010
08:40 AM
|
0
|
0
|
1029
|
|
POST
|
Sorry for the delay, I was out of the office all last week. See the code below for a simple example. It has an address harded coded but you could easily take the house # and street name from input boxes on the web page. Also look into the JavaScript reference & samples on http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=home
<!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=EmulateIE7" />
<title>Test</title>
<style type="text/css">
@import "http://serverapi.arcgisonline.com/jsapi/arcgis/1.5/js/dojo/dijit/themes/tundra/tundra.css";
</style>
<script type="text/javascript"> djConfig = { parseOnLoad: true }</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.5"></script>
<script type="text/javascript">
//make sure required modules loaded for map, nav tools, tasks
dojo.require("dojo.parser");
dojo.require("esri.map");
dojo.require("esri.tasks.query");
//global for the Map
var map;
//globals for various map services
var BaseMap = new esri.layers.ArcGISTiledMapServiceLayer("http://maps1.larimer.org/ArcGIS/rest/services/mapsCached/Basemap/MapServer", {id:"BaseMap"});
var qryLarco = new esri.tasks.QueryTask("http://maps1.larimer.org/ArcGIS/rest/services/mapsCached/Basemap/MapServer/133");
function init() {
var startExtent = new esri.geometry.Extent(3090061, 1415999, 3152561, 1465999, new esri.SpatialReference({ wkid: 2231 }));
map = new esri.Map("mapDiv", { extent: startExtent});
map.addLayer(BaseMap);
}
function findParcel(){
var query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["parcelnum"];
//goto city gardens
query.where = "LOCADDRESSNUM='2145' and LOCSTREETNAME='CENTRE'";
qryLarco.execute(query, zoomtoParcel );
}
function zoomtoParcel(results){
//remove all graphics on the maps graphics layer
map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.5]));
console.log(symbol);
console.log(results);
//example assumes only 1 feature returned
var graphic = results.features[0];
graphic.setSymbol(symbol);
//Add graphic to the map graphics layer.
map.graphics.add(graphic);
map.setExtent(graphic.geometry.getExtent());
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div id="mapDiv" style="margin:1px; border:1px solid black; height:480px;width:600px;">
</div>
<button id="btnParcel" onclick="findParcel();">Find Parcel</button>
</body>
</html>
... View more
07-21-2010
07:01 AM
|
0
|
0
|
791
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-15-2016 03:27 PM | |
| 1 | 01-14-2016 09:55 AM | |
| 2 | 12-14-2012 09:38 AM | |
| 2 | 10-23-2017 01:22 PM | |
| 3 | 01-15-2013 07:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-17-2024
08:14 PM
|