[OpenLayers-Users] creating a popup at the moment a vector featureis created

Puneet Kishor punk.kish at gmail.com
Fri Oct 7 14:49:45 EDT 2011


Tito,

As I stated in my original message --

On Oct 7, 2011, at 8:49 AM, Tito, Joseph wrote:

> 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
> 
> 

> 
> 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

I know how to do all of the above.


> 4) Create a popup at the same location
> 
> 	Popup examples:
> http://openlayers.org/dev/examples/popupMatrix.html

but I am unable to create a popup automatically. See my original email below.

Note that I don't want a popup on click. I want a popup to come up at the tip of the vector feature at the instant the feature is created, kinda like an annotation.


> 
> Good luck!
> 
> -----Original Message-----
> From: openlayers-users-bounces at lists.osgeo.org
> [mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Puneet
> Kishor
> Sent: Thursday, October 06, 2011 2:55 PM
> To: openlayers-users at lists.osgeo.org
> 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
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list