GWW2007


Not doing anything fancy - just supplying some text to popup for a bunch of pushpins.

Location of popup is fine in IE, but in Firefox the y coord discrepancy gets worse the larger the y-pixel value of the pushpin is in the map.

Anyone know of a workaround



Re: Popups for pushpins have wrong Y coord in Firefox

SoulSolutions


I have done quite a bit with custom popups without this issue.

Is there some minimal sample code or site you could point us too to reproduce the problem

John.







Re: Popups for pushpins have wrong Y coord in Firefox

GWW2007

I hacked up a demo at http://durango.farecompare.com/maps/myAirportCategoryMap departure=DFW&category=Europe

Also - there is an example in the Virtual Earth for a custom callback which displays a different looking popup (a div that stays put and you have to dismiss) - but the source tab doesnt show the code for how it works.

Do you know have any example code of how that works

regards


Graeme





Re: Popups for pushpins have wrong Y coord in Firefox

SoulSolutions

Yeah, that link doesn't seem to go anywhere mapish.

And the getaway maps are giving a 404 - /search/compareDestinations.html was not found on this server.

This shows how to do custom popups - its actually showing how to load the content on demand but you can simply use the title and detials:

http://www.soulsolutions.com.au/Articles/PopupContentonDemand/tabid/98/Default.aspx

John.






Re: Popups for pushpins have wrong Y coord in Firefox

madison23

Hi John,

I'm experiencing the same problem GWW2007 mentioned. It happens with VE code run in IE (6&7) when the window isn't maximized. I'm also experiencing the issue when the pushpins are near the bottom of the map in IE7 even while the window is maximized. Is this user error or a bug

As an example, I used the code from Chandu Thota's article "Code Your Applications To Deliver The World With Virtual Earth APIs" (I updated the code to use version 4 of the map control):

<html>
<head>
<title>Programming Virtual Earth</title>
<script src="http://dev.virtualearth.net/mapcontrol/v4/MapControl.js"> </script>
</head>
<body MS_POSITIONING="GridLayout">
<div id="mymapcontroldiv" style="position:relative;width:940px;height:550px;">
</div>
<script>
var map = new VEMap("mymapcontroldiv");
map.LoadMap();
var pushpin = new VEPushpin('1', //Id - must be unique
new VELatLong(47.6, -122.33), //latitude, longitude
null, //icon url
'Seattle', //Title
'The emerald city');
map.AddPushpin(pushpin);

</script>
</body>
</html>

Please try this and let me know if you experience the same strangeness!

Thanks,

John





Re: Popups for pushpins have wrong Y coord in Firefox

Derek Chan

Okay I'm not too clear what the problem your experiencing.  Is the pop-up showing up in the wrong position   Is the pushpin moving too far when your shifting the y-co-ordinates  

Can you post some instructions on how to duplicate the bug along with screenshot if possible




Re: Popups for pushpins have wrong Y coord in Firefox

madison23

HI Derek,

Thanks for your response. Here's a link to a screen shot of the issue:

http://www.technowheels.com/issue1.jpg

Here's the code I used. As I mentioned earlier, I got it right from Chandu's article.

http://www.technowheels.com/test2.html

I'm not doing anything tricky with the map . . . as you can see in the screen shot, the map is not maximized and the pushpin is near the edge of the map. Those are the only requirements I know of to cause the issue. Could it be a monitor/graphics card issue

Thanks again,

John





Re: Popups for pushpins have wrong Y coord in Firefox

Derek Chan

Could be a grapic card/monitor issue that your referring to.  I've tried to re-duplicate it on my browser (IE and FF 1.5) but to no avail I can't seem to see this issue.  I know that having VE on high resolution computers causes some functions to fail (such as pixeltolatlong) but it seems to work okay for me on 1280 x 1024 resolution.




Re: Popups for pushpins have wrong Y coord in Firefox

madison23

I know this issue has been discussed before. I remember reading the following from: http://virtualearth.spaces.live.com/Blog/cns!2BBC66E99FDCDB98!8041.entry

"Dan - VEPushpin pop-up detail information doesn't show at the correct location if the map doesn't appear at the top of the web page (or needs to be scrolled into view). I've replicated this on http://local.live.com/ by moving the MapContainer DIVs position down a few hundred pixels. The map then comes out the bottom and hovering over any pin with showdetail similarly misplaces the detail pop-up. Or simply a map with CSS top:2000px position: absolute; does the trick. Or I'm missing something....February 04 5:52 PM"

It's too bad we don't have a more definitive answer. I hate asking users to turn down their resolution . . . .the maps look great at high res!

Is this issue you are aware of ("I know that having VE on high resolution computers causes some functions to fail (such as pixeltolatlong) but it seems to work okay for me on 1280 x 1024 resolution") documented anywhere I'd like to be able to reference it for my users.

Thanks again,

John





Re: Popups for pushpins have wrong Y coord in Firefox

Derek Chan

Sure, basically a call to map.pixeltolatlong() method will return NaN if the resolution is very high (like 1280 x 1024) so calling the method will give you an error message "[stack overflow]". This is a bug in VE and a workaround hasn't been discovered yet




Re: Popups for pushpins have wrong Y coord in Firefox

SoulSolutions

I see now.

I used this to get the position of the actual pin div so i could get custom popups to work in birdseye mode. It should work for you.

var element2 = document.getElementByID(ID+ "_" + map.GUID);
var element = document.getElementByID(ID);
x = element.offsetLeft + element.offsetParent.offsetLeft + (element2.offsetLeft + element2.offsetWidth / 2);
y = element.offsetTop + element.offsetParent.offsetTop + (element2.offsetTop + element2.offsetHeight / 2);

John.






Re: Popups for pushpins have wrong Y coord in Firefox

madison23

Hi John,

Thanks for your reply- I'm a big fan of your work.

I'm afraid I'm not sure how to use the code you've suggested. Where do the x & y values get used

Thanks,

John





Re: Popups for pushpins have wrong Y coord in Firefox

SoulSolutions

Sorry, reading my answer it makes no sence hey

You can capture the popup by doing this:

VEPushpin.ShowDetailOnMouseOver = false;
VEPushpin.OnMouseOverCallback = PinHover;

and then in the new "PinHover" function you get the x and y value for the pin. The idea is you can manully correct it and then make the popup appear in the correct place.

Check this out for an example just ignore the AJAX content part and simple set the details and title in the "PinHover" (plus correct the position as required)

http://www.soulsolutions.com.au/Articles/PopupContentonDemand/tabid/98/Default.aspx

John.






Re: Popups for pushpins have wrong Y coord in Firefox

madison23

Hi John,

Thank you again for your post. I used the code that you posted here:

http://viavirtualearth.com/Wiki/PopupContentonDemand.ashx

I believe it implements the changes you suggested to me above. When I use this code, I still encounter the issue in both IE 6 & 7. Do you have any other thoughts

Thanks,

John





Re: Popups for pushpins have wrong Y coord in Firefox

SoulSolutions

Ok so with that code you now have a function that is supplied the y coord.

Alone it simply launches the ERO as per VE (still has the error) but I wonder if:

a) you can correct the Y value and still use the default ERO popup

b) correct the y value and use a custom popup instead.

I have the basics of a custom popup here:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1272446&SiteID=1

John.