Puneet,

Here is some pseudo code and snippets that might help you get started:

1) Register an event listener for when the user clicks the map

        map.events.register('click', map, createFeatureAtLocation);

2) Grab the location the user clicked the map

        function createFeatureAtLocation(event) {
        
                // event.xy.x and event.xy.y is the pixel location of
the mouse click
        }

3) At that location, create your vector feature, add it to a layer
4) Create a popup at the same location

        Popup examples:
http://openlayers.org/dev/examples/popupMatrix.html

Good luck!

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Puneet
Kishor
Sent: Thursday, October 06, 2011 2:55 PM
To: [email protected]
Subject: [OpenLayers-Users] creating a popup at the moment a vector
featureis created

I want to accomplish the following --

1. the user clicks on the map
2. a vector feature is created, say, an arrow (or whatever) 3. a small
popup is created right next to the feature with a 
   couple of feature attributes in it. The popup would be 
   anchored to the feature at a predefined point, say, bottom 
   left.

like so

  +-----------+
  | name: foo |
  | rate: 20  |
  +-----------+
  ^
 /|\
  |
  |


I don't know how to accomplish #3 above.

--
Puneet Kishor

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to