Select to view content in your preferred language

cursor tolerance location

837
5
08-25-2011 03:46 PM
MichaelKaminski1
Emerging Contributor
I have a cursor on my web map used to select a location for infowindows, currently it seems to select the location within the specified tolerance of the bottom left of the cursor. I would like to have it select from the top left of the cursor if anyone can help?
0 Kudos
5 Replies
StephenLead
Honored Contributor
Michael,

Can you give some sample code to show what you're seeing?

This sample seems to show the infoWindow appearing at the top-left of the location clicked. Is this not what you're seeing?

What is the infoWindow showing, and how are you opening it?

Steve
0 Kudos
MichaelKaminski1
Emerging Contributor
I made a change to how the switching between visible services is done. I was using

map.removeAllLayers();

and changed to

map.destroy();

and the popUp (sorry about saying infoWindow)  now uses the top left of the cursor. The problem then is that i then have call the init(); function which in turn sets the extent to the initial extent.

another issue i just noticed with using the map.destroy(); is that i seem to get overlaying scalebars? using the map.removeAllLayers(); doesn't give this issue??
0 Kudos
StephenLead
Honored Contributor
Hi Michael,

It sounds like there's something else going on here, since removing the layers shouldn't have any effect on the infoWindow's position.

Sometimes when elements aren't lining up correctly on the map it can be due to a misplaced DIV which is interfering with the map.

Are you able to post your code, or a link to your map?

Steve
0 Kudos
MichaelKaminski1
Emerging Contributor
There is definitely an interaction type issue causing it.... in my attempt to strip the file down to send it the issue disappeared...

I have attached the entire code, the loading is at line 859.
0 Kudos
StephenLead
Honored Contributor
There is definitely an interaction type issue causing it.... in my attempt to strip the file down to send it the issue disappeared...

I have attached the entire code, the loading is at line 859.


Michael,

Can you outline the steps needed to reproduce the problem using your sample code? The infoWindows are appearing in the correct position for me, as far as I can tell.

A suggestion is to load in the layers as Feature Layers. Clicking on a feature would display the popup, and would remove the need to run an Identify task.

See this map as an example. The polygons are loaded as a feature layer, and are highlighted on MouseOver. The infoWindow appears when you click on a feature - when you click off a feature, nothing happens.

This means that you don't see the "No Information Available" message when no features are found.

(If you like, I'd be happy to make a site visit to GBRMPA to assist in-person 🙂

Hope this helps,
Steve
0 Kudos