<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoPlainText>Alexandre,<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Thanks for the help!  After a bit of fiddling, I'm not
plotting my own features on the map and getting the pop-ups to work.  I started
with the sample code and hacked that up a bit. At this point, I'm still not
sure why it's working, but since it is, investigation is much easier. <o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I spent some time understanding the source for OpenLayer.Handler.Point
and family; that was very helpful.  My complements to the authors (not sure if
that's you), OpenLayers is very well thought-out &amp; implemented.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Regards,<o:p></o:p></p>

<p class=MsoPlainText>gene<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>-----Original Message-----<br>
From: Alexandre Dube [mailto:adube@mapgears.com] <br>
Sent: Friday, January 16, 2009 10:50 AM<br>
To: Gene Sally<br>
Cc: users@openlayers.org<br>
Subject: Re: [OpenLayers-Users] Understanding layers and popups</p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Hi Gene,<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Did you look this example : <o:p></o:p></p>

<p class=MsoPlainText>http://openlayers.org/dev/examples/select-feature-openpopup.html<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>What you're trying to do seems to be displayed there.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>You should also look at the draw features example :<o:p></o:p></p>

<p class=MsoPlainText>http://openlayers.org/dev/examples/draw-feature.html<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Also, your vector layer must be on top of all others for
this to work. <o:p></o:p></p>

<p class=MsoPlainText>Or, layers on top must not be visible or not inRange.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Best of luck,<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Alexandre<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Gene Sally wrote:<o:p></o:p></p>

<p class=MsoPlainText>&gt; Hi,<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; I've been slogging through getting this to work (my
map renders on the page now) and I'm having trouble getting my head around how
layers and the click/hover callbacks work.  The goal is to get a popup working
on arbitrary points added to the map.<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; I have a map with an Image baselayer and a Vector
layer where the features have been added, like so<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; var newPoint = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point());<o:p></o:p></p>

<p class=MsoPlainText>&gt; var lonlat = map.getLonLatFromPixel(new
OpenLayers.Pixel(x,y));<o:p></o:p></p>

<p class=MsoPlainText>&gt; newPoint.geometry.x = lonlat.lon;<o:p></o:p></p>

<p class=MsoPlainText>&gt; newPoint.geometry.y = lonlat.lat;<o:p></o:p></p>

<p class=MsoPlainText>&gt; targetLayer.drawFeature(newPoint,
OpenLayers.Util.extend(OpenLayers.Feature.Vector.style['default'], {}));<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; So far so good!  The points appear in the
targetLayer as expected.  (But, when I use the zoom control, they don't zoom
with the map, but that's another day's problem...)<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; I added a OpenLayers.Control.SelectFeature<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; selectControl = new OpenLayers.Control.SelectFeature(<o:p></o:p></p>

<p class=MsoPlainText>&gt;                       targetLayer,<o:p></o:p></p>

<p class=MsoPlainText>&gt;                       {onSelect: onTargetSelect,
onUnselect: onTargetUnselect});<o:p></o:p></p>

<p class=MsoPlainText>&gt; selectControl.activate();<o:p></o:p></p>

<p class=MsoPlainText>&gt; map.addControl(selectControl);<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; When click on a newPoint on the map, the reaction is
like I'm selecting the baselayer. What I can't figure out is how to make the
targetLayer the active layer, as from reading the mail logs, it appears like
the SelectFeature works for the active layer.  I've read/reread the
sundials.html code (as that's close to the affect I want) and can't figure out
what I'm doing wrong.<o:p></o:p></p>

<p class=MsoPlainText>&gt;<o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt; With Regards,<o:p></o:p></p>

<p class=MsoPlainText>&gt; gene<o:p></o:p></p>

<p class=MsoPlainText>&gt; _______________________________________________<o:p></o:p></p>

<p class=MsoPlainText>&gt; Users mailing list<o:p></o:p></p>

<p class=MsoPlainText>&gt; Users@openlayers.org<o:p></o:p></p>

<p class=MsoPlainText>&gt; http://openlayers.org/mailman/listinfo/users<o:p></o:p></p>

<p class=MsoPlainText>&gt;   <o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>-- <o:p></o:p></p>

<p class=MsoPlainText>Alexandre Dubé<o:p></o:p></p>

<p class=MsoPlainText>Mapgears<o:p></o:p></p>

<p class=MsoPlainText>www.mapgears.com<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>