[OpenLayers-Dev] arbitrary element as marker?
Paul Spencer
pspencer at dmsolutions.ca
Tue Jun 17 10:00:12 EDT 2008
On 17-Jun-08, at 9:34 AM, Christopher Schmidt wrote:
> On Tue, Jun 17, 2008 at 09:21:35AM -0400, Paul Spencer wrote:
>> I could put two markers in the same location but that seems horribly
>> inefficient.
>
> How so? You're creating the same number of HTML elements, right?
yes. Perhaps 'horribly' was overstated ;) but the problem I perceive
is the drawing of each marker would go through the draw() process
which calls modifyAlphaImageDiv a couple of times, once in draw and
again in moveTo. I haven't profiled this but I'm sure it adds a few
milliseconds per marker to call this function and it seems wasteful to
duplicate it when you really just need to position the containing
element and let the developer position everything else statically
inside the containing element.
Another reason for not wanting to do individual markers is that I
would like to make the marker a bit more dynamic by adding some event
handlers (mouse over etc).
In ka-Map, the equivalent to the Marker/Icon combo was a method called
addObjectGeo which allowed you to place an HTML element at a
geographic location and have the location managed by the
'API' (including offsets from top/left etc) and I found this very
convenient.
I'll create an enhancement ticket to solicit implementation suggestions.
Cheers
Paul
>
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
__________________________________________
Paul Spencer
Chief Technology Officer
DM Solutions Group Inc
http://www.dmsolutions.ca/
More information about the Dev
mailing list