Infowindow sizing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Infowindow sizing

Jordan Anderson
Hi all,

I've added a feature to Ride the City that allows users to pass a
query string to the application in order to default a starting point,
ending point, and an image that appears in the infowindow for the
ending point.

This all works great, except that the first time the infowindow
appears, its position relative to the marker is based only on the text
that I pass in as content, not the image. So the top of the infowindow
is too low relative to the marker. If I close the infowindow and
reopen it, the position of the infowindow is corrected.

Here is a URL where you can reproduce this. The stop sign's infowindow
should be positioned incorrectly at first (it will obscure the
marker), but if you close it and then click the stop sign again, it is
positioned correctly:
http://geos.ridethecity.com/_wml_/index.php?region=nyc&ename=Tour%20de%20Brooklyn&epoint=-73.96991729736328%2040.67211067645437&eimg=http://geos.ridethecity.com/_wml_/images/tdb.png&fixend=1

Is there some way I should be sending a hint to the infowindow that it
should expecting a nice tall image?

Thanks,
Jordan
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Infowindow sizing

Vladimir Agafonkin
Hi, Jordan,

Yes, try setting the width and height properties of the image - that way the infowindow will know how to size before the image is loaded.

On Fri, Apr 10, 2009 at 5:26 PM, Jordan Anderson <[hidden email]> wrote:
Hi all,

I've added a feature to Ride the City that allows users to pass a
query string to the application in order to default a starting point,
ending point, and an image that appears in the infowindow for the
ending point.

This all works great, except that the first time the infowindow
appears, its position relative to the marker is based only on the text
that I pass in as content, not the image. So the top of the infowindow
is too low relative to the marker. If I close the infowindow and
reopen it, the position of the infowindow is corrected.

Here is a URL where you can reproduce this. The stop sign's infowindow
should be positioned incorrectly at first (it will obscure the
marker), but if you close it and then click the stop sign again, it is
positioned correctly:
http://geos.ridethecity.com/_wml_/index.php?region=nyc&ename=Tour%20de%20Brooklyn&epoint=-73.96991729736328%2040.67211067645437&eimg=http://geos.ridethecity.com/_wml_/images/tdb.png&fixend=1

Is there some way I should be sending a hint to the infowindow that it
should expecting a nice tall image?

Thanks,
Jordan
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev



--
Vladimir Agafonkin
Front-End Architect, CloudMade
+380 93 745 44 61

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev