Select to view content in your preferred language

Location of click  moves after using zoom or identify tool

1468
11
Jump to solution
02-08-2012 10:56 AM
by Anonymous User
Not applicable
Original User: monzay

Coming up with a useful title was challenging!

The other day I added an identify task to my application. While it worked I noticed that the leader line from the popup window points to a location that is different from where I clicked. For example, in my attached screenshot I would have clicked about a 1/2 inch below Tampa but the leader point appears all of the way up in North Florida.

Today I added a navigation toolbar and I noticed that the zoom box begins drawing above and to the left of where my mouse clicked on the map. In the attached screenshot I would have started my zoom box to the left of the Miami text.

Any ideas why this might be happening?
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: swingley

Try out the attached files. The issue was that your nav toolbar was inside the map div. To fix it, I added an additional border container and put the nav toolbar in its own content pane and the map is another content pane.

The page structure now looks like this:
<main border container>   <content pane: header>   <contnet pane: sidebar>   <content pane: rest of the page>     <nested border container for map and toolbar>       <content pane: header to hold nav toolbar>       <content pane: map>     <closing tag for nested border container>   <closing tag for "rest of the page" content pane> <closing tag for main page border container>


I also added some CSS to get ride of the padding on content panes (personally, I prefer this to the default padding in the claro theme):
.claro .dijitContentPane {   padding: 0 !important; }

View solution in original post

0 Kudos
11 Replies
derekswingley1
Deactivated User
CSS. Are you specifying any margin and/or padding on the div you're using for the map? If so, get rid of it. Also, read this thread:  http://forums.arcgis.com/threads/47975
0 Kudos
by Anonymous User
Not applicable
Original User: stevel

Today I added a navigation toolbar and I noticed that the zoom box begins drawing above and to the left of where my mouse clicked on the map


This indicates that the navigation toolbar is pushing the map contents downwards. Try putting the Toolbar's DIV outside of the Map's DIV, as in the example here.

Steve
0 Kudos
MikeOnzay
Frequent Contributor
I started out with that sample, however, my application uses a bordercontainer and several contentpanes. When I placed the toolbar's DIV outside of the map's DIV strange things happen with the UI.


This indicates that the navigation toolbar is pushing the map contents downwards. Try putting the Toolbar's DIV outside of the Map's DIV, as in the example here.

Steve
0 Kudos
by Anonymous User
Not applicable
Original User: monzay

CSS. Are you specifying any margin and/or padding on the div you're using for the map? If so, get rid of it. Also, read this thread:  http://forums.arcgis.com/threads/47975


No to the question on the margins. I read the other post and I'm not sure where to put map.reposition(); in my code. I tried putting it at the end of my init() function. I tried putting it after
dojo.connect(dijit.byId('mapDiv'), 'resize', map, map.resize);map.reposition();
0 Kudos
by Anonymous User
Not applicable
Original User: swingley

You should only need to call reposition() if you've changed the position of the map. You should not need to call it immediately after creating the map.

Can you post the html, css and js you're using? Or maybe even a simplified page that shows the problem?
0 Kudos
MikeOnzay
Frequent Contributor
You should only need to call reposition() if you've changed the position of the map. You should not need to call it immediately after creating the map.

Can you post the html, css and js you're using? Or maybe even a simplified page that shows the problem?


I tried to simplify my app as much as possible but it was still too long for this reply window. I have attached the files. You will need to change the extensions on the files. efhm_style.txt to .css and the other one to .html
0 Kudos
by Anonymous User
Not applicable
Original User: swingley

Try out the attached files. The issue was that your nav toolbar was inside the map div. To fix it, I added an additional border container and put the nav toolbar in its own content pane and the map is another content pane.

The page structure now looks like this:
<main border container>   <content pane: header>   <contnet pane: sidebar>   <content pane: rest of the page>     <nested border container for map and toolbar>       <content pane: header to hold nav toolbar>       <content pane: map>     <closing tag for nested border container>   <closing tag for "rest of the page" content pane> <closing tag for main page border container>


I also added some CSS to get ride of the padding on content panes (personally, I prefer this to the default padding in the claro theme):
.claro .dijitContentPane {   padding: 0 !important; }
0 Kudos
MikeOnzay
Frequent Contributor
Thank you very much. I thought an additional container might be needed but I had difficulty understanding how to do it despite the example here.
0 Kudos
MikeOnzay
Frequent Contributor
It turns out that this fix (testing using your attached files) does not work in IE. It works in Chrome and FF. This is where I'm getting the "Out of Memory at line: 48" error.

Try out the attached files. The issue was that your nav toolbar was inside the map div. To fix it, I added an additional border container and put the nav toolbar in its own content pane and the map is another content pane.
0 Kudos