[OpenLayers-Users] popup hidden when goes on sides of viewport

Kusum kusum at infobase.in
Wed May 14 06:29:29 EDT 2008


Thanks for thr reply Eric

But still things are a bit messy.

I am using this code:---

 markers.events.register('mouseover', markers, function(evt) {  feature = 
new OpenLayers.Feature(layer,new OpenLayers.LonLat(maplon,maplat));
	var maplon_new=maplon+0.005;
	var maplat_new=maplat+0.06;
var coord = new OpenLayers.LonLat(maplon_new,maplat_new);

    var si = new OpenLayers.Size(240,410);
	var link ="<a href='javascript:returnimages();getpics();' >Refresh 
Images</a>";
				var temp ="<div class='tooltip' id='data'>Name:-"+name+"<BR><BR><FONT 
type=verdana size=1> 
Desc:-"+p+"</font><br><br>"+imagestr_final+"<br>"+link+"<br></div>";
               // popup = new OpenLayers.Popup("pof",coord,si,temp,true 
,{autoSize:true},{panMapIfOutOfView:true});
             popup = new 
OpenLayers.Popup.FramedCloud("chicken",coord,si,temp,null, true, 
onPopupClose);

                popup.setBackgroundColor("transparent");
			  var maplon_test=maplon+0.04;
				map.setCenter(new OpenLayers.LonLat(maplon_test,maplat),8);
                map.addPopup(popup);

});


       });


        }
function onPopupClose(evt) {
            markers.map.removePopup(popup);
                popup.destroy();
                popup = null;
        }


and its giving this error

OpenLayers.Popup.FramedCloud is not a constructor.

I am confused wat the problem is

Pls suggest..

Regards
Kusum



--------------------------------------------------
From: "Eric Lemoine" <eric.c2c at gmail.com>
Sent: Wednesday, May 14, 2008 2:05 PM
To: "Kusum" <kusum at infobase.in>
Cc: "Openlayers Users" <users at openlayers.org>
Subject: Re: [OpenLayers-Users] popup hidden when goes on sides of viewport

> On Wed, May 14, 2008 at 7:28 AM, Kusum <kusum at infobase.in> wrote:
>> Dear All,
>>
>>
>> I am trying to make some nice looking popups and want that the map should
>> pan itself when popup goes to the corner
>> so that the popup comes in the center and is not hidden on any corners.
>>
>> I am trying to use panMapIfOutOfView but its not working
>>
>> popup = new OpenLayers.Popup("pof",coord,si,temp,true
>> ,{autoSize:true},{panMapIfOutOfView:true});
>>
>> Please suggest.
>>
>> Also Can u please suggest me where can I find some examples of good 
>> popups??
>
> You may like the FramedCloud popups that are in 2.6. Check this
> example <http://www.openlayers.org/dev/examples/sundials.html>
>
> Cheers,
>
> --
> Eric 





More information about the Users mailing list