[OpenLayers-Dev] RFC: Creating IconManager utility class

Ian Mayo ian at planetmayo.com
Wed Oct 17 14:54:36 EDT 2007


Hi,
all.  I'm working away on #1073 [1], and making steady progress [2].
I'm finding myself bolting on quite a bit of code to support the
specification of size & location of the icon images themselves.
There's still more processing to be done to translate "Pizza
Restaurants" to "pizza.png".  Rather than pollute the georss.xml class
with this functionality I intend creating an IconManager class that
performs as follows:
- it takes a size, offset, root and suffix parameters
- it is able to provide an openlayers.icon when provided with a String
(an rss category from my implementation of georss.xml) - or returns
null if it can't provide an image.
- it has over-rideable function to determine the image to produce,
though the default functionality will be to convert the string to
lower case and swap underscores for spaces - then prepend with the
root and append with the suffix

I'm got the following questions:
- can anybody point me to a suitable folder to contain this functionality
- should it be included in its own ticket?
- any other thoughts?

In the working branch at [2], you still load georss.xml, but observe
that some of the rss entries have had arbitrary categories added - and
see the unique markers shown

[1]  http://trac.openlayers.org/ticket/1073
[2] http://dev.openlayers.org/sandbox/ianmayo/branches/rss/openlayers/examples/georss.html

-- 
Ian Mayo
PlanetMayo Ltd



More information about the Dev mailing list