POST
|
Thanks for the link Kelly. I actually found the issue this afternoon and was logging on to post the fix, and your link was dead on, the doctype was exactly the issue. I've never thought to look at the doctypes on our site and we had an old one being use from years ago when it first went live. Thanks again for the help!
... View more
12-23-2010
07:37 PM
|
0
|
0
|
168
|
POST
|
I'm not sure I understand exactly what your asking for, but it sounds similar to something I have done in the past. I run a query and get back a featureSet, in each feature that returns there is an attribute object in my case there was a particular variable in that attribute object called entityType. Depending on the entityType I displayed a different symbol on the map. for example if the feature had an entityType of "Person" I displayed a red teardrop, if the feature had an entityType of "Organization" I displayed a green teardrop, for "Vehicle" it was yellow, etc, etc... I handled this by setting up what I called a symbolBank, which was a javascript object that worked pretty much like a java HashMap; the code looks like this...
symbolBank = {
"Person": new esri.symbol.PictureMarkerSymbol('/images/red_teardrop.png', 25, 25),
"Organization": new esri.symbol.PictureMarkerSymbol('/images/green_teardrop.png', 25, 25),
"Vehicle": new esri.symbol.PictureMarkerSymbol('/images/yellow_teardrop.png', 25, 25)
}
Access the object by looping through the featureSet and keying off of the attribute you need to create the symbol. In my case it looks like this...
dojo.forEach(featureSet, function(feature){
var symbol = symbolBank[feature.attributes.entityType];
var graphic = new esri.Graphic(feature.geometry, symbol);
map.graphics.add(graphic);
});
... View more
12-22-2010
06:15 PM
|
0
|
0
|
272
|
POST
|
In the example link you gave the "ok" button seems to work in IE8 .... is it supposed to?
... View more
12-22-2010
08:10 AM
|
0
|
0
|
747
|
POST
|
I'm working on a J2EE project with a struts MVC framework that wanted a nice geospatial addition for viewing their data. The project was a success and now we are working out a few kinks that we had to place workarounds in for on the first pass. One of these kinks are how infowindows are displayed on the map by IE(7/8). Basically anytime an info window is drawn with a lower right or left anchor something in the way its displayed gets hosed. It looks like some kind of spacing or sizing issue with the sprite image, see pictures below... our workaround was to set a fixed anchor when the page loads in IE so it always uses one of the upper right or left anchors; as you can see from the image the graphic is acceptable (but still not quite right) when displayed with those anchors. Now I have stripped everything out of our site other than what is necessary to draw the map and one graphic with an info window testing along the way to try and find out what bit of html, javascript, or css in our site might be throwing it off but I got all the way down to literally nothing but the map on a blank page and its still doing it. The only thing that is different here from a straight up vanilla html page is that the html is in a jsp that is pulled in from a struts back end. conversely, i have built up a page (w/o out using struts) mimicking our site as much as possible in layout and style and have not been able to reproduce this error. The only conclusion I can draw so far is that something about loading this in jsp's or via struts is throwing it off in IE... Has anyone ever seen this behavior? If so, were you able to fix it?
... View more
12-22-2010
04:32 AM
|
0
|
2
|
523
|
POST
|
I'm putting together a system in which there is a case where a client machine needs to access the mapping portion of our web-app and still have full functionality w/o internet access. We host the javascript api (currently on version 1.6) locally so that does not pose a problem. Where we do have a problem is loading our basemap: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" What we would like to have happen is try to load the ArcGISTiledMapServiceLayer basemap and when/if it fails fall back to an ArcGISDynamicMapServiceLayer that we serve up locally. Currently I have the tiled service layer wired up to an "onLoad" event which calls a function that creates the map adds the tiled layer as the base map if it has finished loading, then it proceeds to load the dynamic layer to the map. I also have an "onError" wired up to the tiled layer so if it times out and fails to load it will still call the function to initialize the map but instead of adding the tiled layer as the base map it skips it and adds the dynamic layer instead. The problem seems to be when the tiled layers "onError" is triggered the map that gets created never calls its "onLoad" function to initialize the rest of its functionality. function init(){
[INDENT]tiledLayer = new esri.layers.ArcGISTiledMapServiceLayer("https://serverz.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", {id:"stlayer"});
dojo.connect(tiledLayer, "onLoad", function(layer){
[INDENT]initMapLayers();
dojo.connect(tiledLayer, "onUpdate", hideLoading);[/INDENT]
});
dojo.connect(tiledLayer, "onError", function(err){
[INDENT]initMapLayers();[/INDENT]
}); [/INDENT]
}
function initMapLayers(){
[INDENT]esri.hide(dojo.byId("loadingImg"));
var ext = new esri.geometry.Extent(-15253161.87, 880554.17, -5958419.23, 7670608.66, new esri.SpatialReference({wkid: 102100}));
map = new esri.Map("map", {lods:lods, extent:ext});
dojo.connect(map, "onLoad", initFunctionality);
nav = new esri.toolbars.Navigation(map);
if(tiledLayer.loaded){
[INDENT]map.addLayer(tiledLayer);[/INDENT]
}
/*** DYNAMIC LAYERS ***/
var dynamicLayer = new esri.layers.ArcGISDynamicMapServiceLayer("url", {id:"urlid", opacity:0.4});
dojo.connect(dynamicLayer, "onUpdate", hideLoading);
map.addLayer(dynamicLayer);[/INDENT]
}
dojo.addOnLoad(init); In order to test the scenario where we have no internet connection i simply put in a url that does not exist for the tiledLayers constructor. The tiledLayers "onError" event is getting triggered properly when it times out but the initFunctionality() function that is registered for the maps "onLoad" event does not seem to be getting triggered when initMapLayers() is called through the "onError" event of the tiledLayer. When I use a correct URL and the tiledLayers "onLoad" event is triggered everything works fine.
... View more
08-10-2010
01:27 PM
|
1
|
1
|
561
|
Title | Kudos | Posted |
---|---|---|
1 | 08-10-2010 01:27 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|