[OpenLayers-Users] Two Popups for a Marker?

Stefanie24 carag at gmx.net
Thu Sep 12 00:32:07 PDT 2013


Hello, i´d like get this to work:
I have several markers from a Database.
On click i get  Marker with much text with info to him.

Therefore i use:

        function onPopupClose(evt) {selectControl.unselect(this.feature);}
        
        function onFeatureSelect(evt) {
    
          feature = evt.feature;
          popup = new OpenLayers.Popup.FramedCloud("featurePopup",
                               
feature.geometry.getBounds().getCenterLonLat(),
                                new OpenLayers.Size(100,100),
                               "
"+feature.attributes.title + "
 " +
                               feature.attributes.markerID,
                               null, true, onPopupClose);
          feature.popup = popup;
          popup.feature = feature;
          map.addPopup(popup);
          position=new
OpenLayers.LonLat(feature.geometry.x,feature.geometry.y);
          marker.move(position);
          position.transform(new OpenLayers.Projection("EPSG:900913"), new
OpenLayers.Projection("EPSG:4326"));

*and later:*

		      gpsmarkerlayer.events.on({'featureselected':
onFeatureSelect,'featureunselected': onFeatureUnselect});
            selectControl = new
OpenLayers.Control.SelectFeature(gpsmarkerlayer);
            map.addControl(selectControl);
            selectControl.activate();

		      jobmarkerlayer.events.on({'featureselected':
onFeatureSelect,'featureunselected': onFeatureUnselect});
            selectControl = new
OpenLayers.Control.SelectFeature(gpsmarkerlayer);
            map.addControl(selectControl);
            selectControl.activate();

		      tourmarkerlayer.events.on({'featureselected':
onFeatureSelect,'featureunselected': onFeatureUnselect});
            selectControl = new
OpenLayers.Control.SelectFeature(gpsmarkerlayer);
            map.addControl(selectControl);
            selectControl.activate();

So far so good.
But *additional *i want to have a small Marker with only one word on *every
Marker* when i open the website.
*
How can i do this?
*



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Two-Popups-for-a-Marker-tp5077444.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list