[Dev] Labelled Markers

Erik Uzureau euzuro at gmail.com
Wed Oct 18 08:42:08 EDT 2006


Hi Andrew,

Your strategy seems pretty good. The trick I think would be to subclass
OpenLayers.Marker, adding a property variable for your label text and
tacking on the relevant code in the draw() and moveto() functions.

--Erik

On 10/17/06, Andrew Larcombe <andrew at andrewlarcombe.co.uk> wrote:
> Hello,
>
> I'm greedy. I'd like to display a text label alongside each Icon in my
> Markers layer. Can anyone point me in the right direction to implement
> this sort of scheme.
>
> My initial thought was of creating a separate Label class, similar to
> the Icon class, which just creates a div, and a <p> child node
> containign the text for the label, then including one of these Label
> objects within the Marker class. Anyone have any comments/pitfalls on
> this approach, or is it just daft?
>
> Cheers,
>
> Andrew
>
> --
> Andrew Larcombe
> Freelance Geospatial, Database & Web Programming
>
> web: http://www.andrewlarcombe.co.uk
> email: andrew at andrewlarcombe.co.uk
> icq: 306690163
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list