[OpenLayers-Users] Temporary point from lonlat

Nicholas Bergson-Shilcock nicholasbs at openplans.org
Tue Mar 3 18:54:10 EST 2009


Excerpts from hfpmartins's message of Tue Mar 03 17:06:31 -0500 2009:
> Hello list,
> 
> I have google geocoder inside my application and i would like to add a
> temporary/on the fly point or png on the geocoded address. This is, after
> entering an address, i have a setCenter to that adress but would like to put
> just something calling the attention to those coordinates. If i add new
> address, then this point would disapear and another point would appear in
> the correct location.
> What do you advise me to use in this situation???
> 

I think the following code does pretty much what you want:

http://trac.openplans.org/openplans/browser/BlockParty/trunk/blockparty/public/js/mapping.js

(The code's from this project: http://sites.openplans.org/blockparty/)

The code is pretty dumb in that every time the marker is "moved" it removes the
old OpenLayers.Feature.Vector object  and then creates a new one at the updated
lat/lon. It's not too pretty, but it works quite well.

Hope this helps,
  -Nick


> Thanks for your help.
> Regards,
> 
> Hugo



More information about the Users mailing list