[OpenLayers-Users] Moving marker dynamically on mouse click.

Jongsuk Lee jongsuk.lee at gmail.com
Sat Nov 5 20:51:45 EDT 2011


thanks for the tip. I will try to recreate marker with click instead
of calling moveTo method...

I am glad that I am not the only one seeing this as an issue.

So, currently marker moveTo is only useful when user do not pan viewport...

I wish library had method moveTo(latitude,longitude,projectionType) .

thanks for the help again.


On Sat, Nov 5, 2011 at 12:02 AM, Carsten Eider <eider at fh-bingen.de> wrote:
> Hi,
>
> I solved a similar issue with a different approach:
> When clicking onto the map the old marker was removed from its layer and
> a new one was set.
> For my luck, there was always only one marker in the layer.
>
> - Carsten
>
> Am 05.11.2011 00:58, schrieb Jongsuk Lee:
>> Hi, I am using 2.1.1 release library and I am using with bing layer.
>> I am trying to do marker to move according to user's mouse click.
>> So old marker should move accroding to new click location. I am using
>> moveTo method in marker object.
>> This seems to work fine when I change zoom but once I pan viewport,
>> position gets hairy.
>> Do I have to keep track of pan viewport movement and offset il?
>> am I not understanding api correctly? I tried on ie9 and latest chrome
>> and that shows same behavior.
>>
>>
>> Any tips would be appreciated. Thanks for awesome library.
>>
>> jong.
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>


More information about the Users mailing list