Alexandre,<br><br>thanks again for your valuable help!<br><br>At the moment the best idea would be to have vector points as markers, which would make them both clickable and perfect for what I need to do.<br><br>I have added this info to the vector layer:<br>
<br>            vectors = new OpenLayers.Layer.Vector(&#39;Vectors&#39;, {<br>                styleMap: new OpenLayers.StyleMap({<br>                    externalGraphic: &quot;images/markers/marker-gold.png&quot;,<br>                    pointRadius: 10<br>
                })<br>            });<br><br>And the point appears correctly with the marker icon. But I have run into 2 problems now:<br><br>1) All my polygons and lines appear black or invisible<br>2) I would like to use more than one image for the markers<br>
<br>My controls looks like this:<br><br>            controls = {<br>                point: new OpenLayers.Control.DrawFeature(vectors,<br>                            OpenLayers.Handler.Point),<br>                line: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.Path),<br>                polygon: new OpenLayers.Control.DrawFeature(vectors,<br>                            OpenLayers.Handler.Polygon),<br>                drag: new OpenLayers.Control.DragFeature(vectors),<br>
                select: selectControl<br>            };<br><br>Is there a way to maybe pass the external image specifically to the &quot;point&quot; control?<br><br>I am unsure about the syntax and I wasn&#39;t able to find any info around, maybe something like this: <br>
<br>point: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.Point, {style: blah blah}),<br><br>If it&#39;s possible, then that solves my 2nd problem as well for different images.<br><br>Thanks in advance!<br><br>Best regards,<br><br>
Alex<br><br><div class="gmail_quote">On Thu, Feb 4, 2010 at 8:26 PM, Alexandre Dube <span dir="ltr">&lt;<a href="mailto:adube@mapgears.com">adube@mapgears.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alex,<br>
<br>
 Take a look at this example [1].  Vector features can be used with a SelectFeature control to open popups.  You only need to define the externalGraphic to have images and define the geometry type to &quot;point&quot;.  See an other example of &quot;draw&quot; types.<br>

<br>
 You might be interested to take a look at this example [3] too (it&#39;s a development sandbox for a RedLining widget in GeoExt).  It uses a lot of OpenLayers components to draw/select the features.  Maybe that can helps too.<br>

<br>
Kind regards,<br>
<br>
Alexandre<br>
<br>
[1] <a href="http://openlayers.org/dev/examples/select-feature-openpopup.html" target="_blank">http://openlayers.org/dev/examples/select-feature-openpopup.html</a><br>
[2] <a href="http://openlayers.org/dev/examples/draw-feature.html" target="_blank">http://openlayers.org/dev/examples/draw-feature.html</a><br>
[3] <a href="http://dev.geoext.org/sandbox/redlining/ux/FeatureEditing/examples/ControlerOnlyExample.html" target="_blank">http://dev.geoext.org/sandbox/redlining/ux/FeatureEditing/examples/ControlerOnlyExample.html</a><br>

<br>
<br>
Alex G. wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Alexandre,<br>
<br>
thanks for your thoughts. Although if I understand what you&#39;re saying and the example correctly, this will not make the markers to pop up with bubbles where I can put text.<br>
<br>
I am currently placing markers with text on them where if you click on the marker a little bubble will appear.<br>
<br>
Here&#39;s another snippet that I forgot to include:<br>
<br>
        var click = new OpenLayers.Control.Click();<br>
        map.addControl(click);<br>
        click.activate();<br>
        var new2 = new OpenLayers.Layer.Text( &#39;Texts&#39;, { layerToUse: markers, newLat: &#39;4188741.7304207&#39;, newLon: &#39;217101.58694106&#39;, newTitle: &quot;Title1&quot;, newDesc: &quot;Desc1&quot;, idUser : &#39;62&#39;, userName: &#39;admin&#39;, newIcon: &#39;images/markers/marker.png&#39;} );<br>

        new2.parseData();<br>
        var new3 = new OpenLayers.Layer.Text( &#39;Texts&#39;, { layerToUse: markers, newLat: &#39;4182021.7304207&#39;, newLon: &#39;210801.58694106&#39;, newTitle: &quot;Title2&quot;, newDesc: &quot;Desc2&quot;, idUser : &#39;62&#39;, userName: &#39;admin&#39;, newIcon: &#39;images/markers/marker-blue.png&#39;} );<br>

        new3.parseData();<br>
        var new4 = new OpenLayers.Layer.Text( &#39;Texts&#39;, { layerToUse: markers, newLat: &#39;4179441.7304207&#39;, newLon: &#39;219681.58694106&#39;, newTitle: &quot;Title3&quot;, newDesc: &quot;Desc3&quot;, idUser : &#39;62&#39;, userName: &#39;admin&#39;, newIcon: &#39;images/markers/marker.png&#39;} );<br>

        new4.parseData();<br>
I am not quite sure what that click function does, could it be the culprit?<br>
<br>
I have used this example as a base: <a href="http://dev.openlayers.org/releases/OpenLayers-2.8/examples/markers.html" target="_blank">http://dev.openlayers.org/releases/OpenLayers-2.8/examples/markers.html</a><br>
The thing is I use a form also to create new bubbles where users can enter a title, marker icon and description and get a result similar to the above.<br>
<br>
Thanks again,<br>
<br>
Alex<br>
<br></div><div><div></div><div class="h5">
On Thu, Feb 4, 2010 at 3:34 PM, Alexandre Dube &lt;<a href="mailto:adube@mapgears.com" target="_blank">adube@mapgears.com</a> &lt;mailto:<a href="mailto:adube@mapgears.com" target="_blank">adube@mapgears.com</a>&gt;&gt; wrote:<br>

<br>
    Alex,<br>
<br>
     I just looked at the SelectFeature control code and I think you<br>
    could try this solution :<br>
<br>
     Change you Marker layer for a Vector one (you can define<br>
    externalGraphic to a vector feature, see an example [1]) and then<br>
    configure your SelectFeature control with both your layers :<br>
<br>
     var select = new OpenLayers.Control.SelectFeature([vectors,<br>
    markers], options);<br>
<br>
     The SelectFeature control will create a RootContainer layer<br>
    object enabling selection on both at the same time, thus fixing<br>
    your issue.   Please, tell me if that worked.<br>
<br>
    Hope this helps,<br>
<br>
    Alexandre<br>
<br>
    [1] <a href="http://openlayers.org/dev/examples/styles-unique.html" target="_blank">http://openlayers.org/dev/examples/styles-unique.html</a><br>
<br>
<br>
    Alex G. wrote:<br>
<br>
        Hi all,<br>
<br>
        I am probably having a conflict problem with some of my<br>
        layers. I currently have 3 layers active on my installation:<br>
        - a layer containing the data from a shapefile (running WMS)<br>
        - a vector layer where users can draw<br>
        - a layer dedicated to markers.<br>
<br>
        I have noticed that if I place a marker, I cannot interact<br>
        with it afterwards unless I hide the vectors layer. The order<br>
        is correct, I load first the shp layer, then the vector one<br>
        and then the markers one.<br>
<br>
        I include here some of my code in hope that it will help, it&#39;s<br>
        mostly from examples on openlayers so there&#39;s really nothing new.<br>
<br>
                   map = new OpenLayers.Map(&#39;map&#39;,{maxExtent: new<br>
        OpenLayers.Bounds(195441.084706006,4171163.51662705,240142.089176109,4203199.94421431),<br>
        maxResolution: 120, units: &#39;dd&#39;});<br>
                   layer = new OpenLayers.Layer.WMS( &#39;Landmass &#39;,<br>
        &#39;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a><br>

        &lt;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a>&gt;<br>

        &lt;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a><br>

        &lt;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a>&gt;&gt;&#39;,<br>

<br>
                   {<br>
                       layers: &#39;zak&#39;,<br>
                       format:&#39;PNG&#39;,<br>
                       bbox:<br>
        &#39;195441.084706006,4171163.51662705,240142.089176109,4203199.94421431&#39;,<br>
                       srs: &#39;EPSG:4326&#39;<br>
                   });<br>
                   lakegr_wms = new OpenLayers.Layer.WMS( &#39;Lakes&#39;,<br>
                              &#39;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a><br>

        &lt;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a>&gt;<br>

        &lt;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a><br>

        &lt;<a href="http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;" target="_blank">http://localhost:8585/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/gmap75a.map&amp;</a>&gt;&gt;&#39;,<br>

<br>
<br>
                       {<br>
                           layers: &#39;sedi&#39;,<br>
                           transparent: &#39;true&#39;,<br>
                           format: &#39;image/png&#39;<br>
                       },<br>
                       {isBaseLayer: false}<br>
                   );<br>
                   vectors = new OpenLayers.Layer.Vector( &#39;Editable&#39; );<br>
                   vectors.onFeatureInsert=function(feature) {<br>
                                    var wkt=wktwriter.write(feature);<br>
                      console.log(wkt);<br>
                   }<br>
                   map.addLayer(layer);<br>
                   map.addLayers([lakegr_wms,vectors]);<br>
                   map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
                       controls = {<br>
                           point: new<br>
        OpenLayers.Control.DrawFeature(vectors,<br>
                                       OpenLayers.Handler.Point),<br>
                           line: new<br>
        OpenLayers.Control.DrawFeature(vectors,<br>
                                       OpenLayers.Handler.Path),<br>
                           polygon: new<br>
        OpenLayers.Control.DrawFeature(vectors,<br>
                                       OpenLayers.Handler.Polygon),<br>
                           drag: new<br>
        OpenLayers.Control.DragFeature(vectors)<br>
                       };<br>
<br>
                       for(var key in controls) {<br>
                           map.addControl(controls[key]);<br>
                       }<br>
<br>
                             map.zoomTo(1);<br>
                   var options = {<br>
                       hover: true,<br>
                       highlightOnly: true<br>
                   };<br>
                                 var select = new<br>
        OpenLayers.Control.SelectFeature(vectors, options);<br>
                   selectCtrl = new<br>
        OpenLayers.Control.SelectFeature(vectors,<br>
                       {<br>
                           clickout: true,<br>
                           onSelect: serialize<br>
                       }<br>
                   );<br>
                   map.addControl(select);<br>
                   map.addControl(selectCtrl);<br>
                   select.activate();<br>
                   selectCtrl.activate();<br>
         *<br>
         * Inherits from:<br>
<br>
                   var markers = new OpenLayers.Layer.Markers(<br>
        &#39;Markers&#39; );<br>
                   map.addLayer(markers);<br>
<br>
        Rest of the code is taken from the markers example on OpenLayers.<br>
<br>
        Can anyone think of any reason why they would conflict? I am<br>
        thinking it has something to do with clicks and some of the<br>
        controls I use might be conflicting although I can&#39;t see any<br>
        Javascript errors.<br>
<br>
        Thanks in advance.<br>
<br>
        ------------------------------------------------------------------------<br>
<br>
        _______________________________________________<br>
        Dev mailing list<br></div></div>
        <a href="mailto:Dev@openlayers.org" target="_blank">Dev@openlayers.org</a> &lt;mailto:<a href="mailto:Dev@openlayers.org" target="_blank">Dev@openlayers.org</a>&gt;<div class="im"><br>
        <a href="http://openlayers.org/mailman/listinfo/dev" target="_blank">http://openlayers.org/mailman/listinfo/dev</a><br>
         <br>
<br>
<br>
    --     Alexandre Dubé<br>
    Mapgears<br></div>
    <a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a> &lt;<a href="http://www.mapgears.com" target="_blank">http://www.mapgears.com</a>&gt;<br>
<br>
<br>
</blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
Alexandre Dubé<br>
Mapgears<br>
<a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a><br>
<br>
</div></div></blockquote></div><br>