POST
|
If it's not a proxy page issue, I've had a problem with FeatureLayers in IE because they are drawn on a strange graphics layer. To fix this, make sure your explicitly set the CSS on your map's div to text-align: left;. Reference to my post that solved this issue that Derek graciously helped me with.
... View more
07-07-2011
11:15 AM
|
0
|
0
|
427
|
POST
|
Hello all-- My project requires a fast, client-side rollover that displays information about certain points on the map. My first thought on this was having a custom InfoWindow a la this sample and putting a Dojo StackContainer in it where it shows the relevant information with respect to the point--that way all the content/images is predefined/loaded from the HTML. However, I'm having trouble thinking about a way to trigger the InfoWindow...How would I tie the InfoWindow open/close events to fire on a mouseover over the points that are on the map? Or maybe I'm looking at this the wrong way. Has anyone implemented anything similar and have a better way to go about doing this? Thanks, Daniel
... View more
07-07-2011
11:08 AM
|
0
|
1
|
555
|
POST
|
As the Internet moves to the "Web 3.0" paradigm, I think it's almost necessary to incorporate the keyboard as a part of my mapping applications. So personally, I use Shortcuts.js to handle the mapping of all of my keyboard shortcuts. It's as simple as adding this to your HTML: <script type="text/javascript" src="shortcuts.js"></script> And then adding the following to your Javascript's init or dojo.addOnLoad: // Define some keyboard shortcuts
var kbdOptions = {
disable_in_input: true,
propagate: false
};
shortcut.add("Escape", function() {
N.myMap.infoWindow.hide();
}, kbdOptions); Other examples: I use F for full extent, I for the identify tool, Q and W for prev/next extent. It really helps the powerusers out there make the most out of your application, without them needing to fumble around with toolbars.
... View more
06-28-2011
10:07 AM
|
0
|
0
|
538
|
POST
|
Well, a specific example of how I use the aforementioned structure is when I call the map's centerAndZoom() function to center and zoom in on a point and then open an InfoWindow. Basically, the event I am listening for is "wait for the map to stop moving," because the InfoWindow will be anchored incorrectly if I invoke it during a map update, as opposed to after. In my experience, this kind of forced synchronization is required very often or else things just don't work as they should. I am getting a feeling that dojo.Deferred can help me out in this regard...but I am not exactly sure how.
... View more
06-24-2011
10:14 AM
|
0
|
0
|
1385
|
POST
|
Thanks for the clarification. I am not sure if this is related or not, but suppose I want to run a function only once after a certain event is finished. Let's say that the event is the map's onUpdateEnd, so after the map is finished zooming/panning, I want it to call some anonymous function as such:
var tempHook;
tempHook = dojo.connect(myMap, "onUpdateEnd", function() {
// do things here
// Disconnect so this doesn't run again in the next onUpdateEnd
dojo.disconnect(tempHook);
tempHook = null;
};
How can I incorporate Dojo.deferred to improve this? Currently the above method is what I have been doing to sync my code.
... View more
06-24-2011
06:34 AM
|
0
|
0
|
1385
|
POST
|
Wonderful post! I have been attempting to wrap my head around Dojo.Deferred for a while now, and your post here and your posts that I've read via forum search have helped significantly. Some questions: Could you mention some practical scenarios where using/handling a Dojo.Deferred is preferred over the typical callback and errback parameters found in many of the API's asynchronous functions? Can you provide more practical examples or scenarios where one would use Dojo.Deferred? For instance, your post is the scenario where we need to add a layer after the map and another layer has been successfully loaded. Could you please clarify the response[0][1]? I am not sure what these represent. Thanks
... View more
06-20-2011
09:31 AM
|
0
|
0
|
1385
|
POST
|
Thank you! That fixed the issue. It seems like the problem occurred due to the map's DOM node having the CSS style text-align: center. Maybe as a fix, you guys can add a CSS rule to force a text-align: left on the map node? As for myself, I fixed the problem by adding text-align: center to the mapDiv's CSS selector. Thanks again for the help. I appreciate it.
... View more
06-10-2011
12:28 PM
|
0
|
0
|
136
|
POST
|
Thanks again. Seeing your markup would be helpful. Can you link to (or post as an attachment) a copy of your HTML? Here you go.
... View more
06-10-2011
10:01 AM
|
0
|
0
|
495
|
POST
|
No worries. Thanks for elaborating and posting additional screen shots. You're definitely not locked into using any dojo dijits but they just make life easier. Can you post your CSS for the page in question? For this to be a bug, we would need to be able to describe it as "Graphics are shifted 50% of the page width when ____ is ____". We still can't do that. I hope this will help: http://arcgis03.crgsc.org/EODay/images/styles.css It might be useful to note that I am also using YUI CSS Reset styles found here, but I don't think that's the problem as the issue still occurred when I didn't import that stylesheet. I can give you the full HTML/JS/CSS source if required, but I'd have to make some temporary map services on our production server which will take some time. Let me know if you need that.
... View more
06-10-2011
09:51 AM
|
0
|
0
|
495
|
POST
|
My apologies for the ESRI quip. I have some stacked elements and overlays that do not fare well with Dojo's Layout management system. Other than this issue, everything else should be cross-browser compatible. The issue (I guess not yet a bug) is that the graphics layer's rendering frame begins at exactly 50% of my page's width, and thus shifts everything to the right. Some proof: In both of these images, I am drawing a zoom rectangle using shift-click and drag. When I make the box on only one half of the page, you can see that the grey shaded rectangle and its thick red border are there in its entirety: Screenshot. But when I drag the rectangle past the exact 50% mark of my page, you will see that the box loses its left border, meaning that I've reached the edge of the rendering "frame": screenshot. So, the root of my problem is that this magic frame is starting from the middle of the page instead of being aligned to the left. Any thoughts? Could this be a legitimate bug? I feel as if the user should not be confined to using Dojo's layout system, especially when the aforementioned rendering frame should just attach to the map's DOM node and not specifically a Dojo dijit.
... View more
06-10-2011
09:28 AM
|
0
|
0
|
495
|
POST
|
Derek, that may be the problem. I decided to stray from using the Dojo Layout manager for this application, and it looks like ESRI is punishing me for that. With how my website works right now, it's very difficult to lay it out using Dojo as everything is CSS-driven and is animated accordingly. Do you happen to know any specifics of what's required to solve this issue? (Such as a BorderContainer/ContentPane wrapping the map div) Also, shouldn't this be listed as an API bug?
... View more
06-10-2011
08:52 AM
|
0
|
0
|
495
|
POST
|
I am having a difficult time with the placement of point data that I am retrieving from a service. The most absurd thing is that all three of the big-name browsers (IE, Firefox, Chrome) are rendering these points completely differently. Here are some screenshots: Internet Explorer 9 Firefox 4 Chrome 11 Although Chrome renders the points correctly, Firefox displays them offset to the right, and Internet Explorer doesn't even display the points within the user's view (you have to scroll to the right in IE to be able to see the points--in other words, the points are even farther displaced to the right than FF). I've looked into this being a projection problem, but debugging in Firebug shows me that every extent and geometry is working in wkid 26915. I attached the code in question below. Any input would be much appreciated. N.fn.initMapIcons = function() {
var qTask, query;
qTask = new esri.tasks.QueryTask(N.fn.getLayerURL("Political", "Polling Places"));
query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["PRECINCT", "SITE", "SITE_ADDRESS", "SITE_ST", "SITE_ZIP"];
// This is a trivial query because we want to grab all values in the table
query.where = "1=1";
qTask.execute(query, function(featureSet) {
var iconsLayer, i, graphic;
iconsLayer = N.myMap.getLayer("Political_Icons");
// Place all our findings into the special graphics layer
for (i = 0; i < featureSet.features.length; i++) {
graphic = featureSet.features;
graphic.setSymbol(new esri.symbol.PictureMarkerSymbol("images/mapIcon_pollingPlaces.png", 24, 24));
iconsLayer.add(graphic);
}
// Enable events so that we can manipulate/customize them, as seen below
N.myMap.graphics.enableMouseEvents();
dojo.connect(iconsLayer, "onMouseOver", function(evt) {
var content, geom;
content = evt.graphic.attributes;
geom = esri.geometry.toScreenGeometry(N.myMap.extent, N.myMap.width, N.myMap.height, evt.graphic.geometry);
N.myMap.infoWindow.setTitle(content.SITE);
N.myMap.infoWindow.setContent(content.PRECINCT);
N.myMap.infoWindow.resize(355, 140);
N.myMap.infoWindow.show(geom, N.myMap.getInfoWindowAnchor(geom));
N.myMap.setMapCursor("pointer");
content = geom = null;
});
dojo.connect(iconsLayer, "onMouseOut", function(evt) {
N.myMap.setMapCursor("default");
N.myMap.infoWindow.hide();
});
iconsLayer = graphic = null;
}, function(error) {
console.log("Error at initMapIcons: " + error);
});
};
... View more
06-10-2011
08:02 AM
|
0
|
11
|
1234
|
POST
|
It's showing up down there because you haven't set it to show at the click's coordinates. I hope this helps.
dojo.connect(myMap, "onclick", function(evt) {
myMap.infoWindow.setTitle("Some title");
dijit.byId("infowinID").setContent("<img src='something.png' />');
myMap.infoWindow.resize(355, 140);
myMap.infoWindow.show(evt.screenPoint, myMap.getInfoWindowAnchor(evt.screenPoint));
});
... View more
04-07-2011
03:29 PM
|
0
|
0
|
536
|
POST
|
My organization has a huge raster that we need to display to show change with time, but right now--even from our LAN--it's rendering pretty slowly without a preload. To help with the speed, we are trying caching, but once we change from a dynamic to a tiled map service, all the time-related images are gone. I was wondering if anyone can share some code with using time-aware tiled maps. Thanks
... View more
03-25-2011
08:51 AM
|
0
|
3
|
1092
|
POST
|
Can you explain what a "hover mouse information tool" is? From what you've told us now, I'm assuming that you're trying to disconnect a function to a previously defined event. So, say that you have this var myHook = dojo.connect(myMap, "onSomeEvent", function() {
doThis();
}); Notice here that the dojo.connect is assigned to a variable.. Now if you want doThis() to stop executing every onSomeEvent, do the following: dojo.disconnect(myHook); Hope that helps.
... View more
02-28-2011
07:05 AM
|
0
|
0
|
259
|
Title | Kudos | Posted |
---|---|---|
1 | 01-27-2011 11:47 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|