[OpenLayers-Users] [work] Re: icons in Layer.Text

Robert J Becraft castlewrks at hughes.net
Tue Oct 9 20:44:56 EDT 2007


See my example at http://www.metaphaze.com/Avalon/AMII_world_map.htm

You will need to use Excell to create the txt file.  Type each column in 
the spreadsheet, then export as a .txt file.  It puts tabs between the 
columns, and makes it readable to OpenLayers.  Using notepad won't 
work.  The column headers are keywords that specify what type of data is 
in that column.  I don't have the link to the help page I found this on, 
it is on the OpenLayer's site though.

I positioned the icon's over the first letter of the layer with the 
country names on it.  You can see this when zooming in.  I did this by 
hand with the spreadsheet open and adjusted the LAT/LON values, 
exporting and reloading the web-page until they were close. 

The icon's themselves are 25x25 pels, I don't adjust the size.  It 
seemed simpler to have them the actual size I wanted them to appear on 
the map.  They are transparent gifs.

Eventually the text detail will come in from a dynamic piece of code I 
haven't finished writing.  One idea I'm toying with is to build a menu 
in the popup that zooms to a variety of features for each of the 
countries.  The final product will depend on my time and how well it 
works when I get to it.

Erik Uzureau wrote:
> Here is example/textfile.txt
>
> point	title	description	icon
> 10,20	my orange title	my orange description	
> 2,4	my aqua title	my aqua description	
> 42,-71	my purple title	my purple description<br/>is
> great.	http://www.openlayers.org/api/img/zoom-world-mini.png
>
>
> You need to add new columns for iconSize and iconOffset, so something like this:
>
> point	title	description	icon	iconSize	iconOffset
> 10,20	my orange title	my orange
> description	http://example.com/icon.jpg	50,50	20,20
>
>
> On 10/8/07, Tara Athan <tara_athan at alt2is.com> wrote:
>   
>>  Erik- sounds good but how do I do that- is there an example somewhere to
>> follow?
>>
>>  Tara
>>
>>
>>  Erik Uzureau wrote:
>>  Hi Tara,
>>
>> What you want to do is to specyify iconOffset and iconSize columns in
>> your text file.
>>
>> Erik
>>
>>
>> On 10/8/07, Tara Athan <tara_athan at alt2is.com> wrote:
>>
>>
>>  I am trying to add nondefault icons for markers using Layer.Text
>> (because I plan to have a large, dynamic set of markers)
>> I want the marker to be smaller than the default marker.
>> Passing a rescaled version of a larger marker caused it to be enlarged
>> and stretched and look really bad.
>> I sort of got it working by placing a marker into a larger canvas, but
>> the tip of the marker doesn't seem to be in quite the right place.
>> Is there some documentation on this, or another way to handle it?
>> Also, is there a way to specifiy the image file for all the markers in a
>> text file without repeating the path in every line?
>>
>> Sample script at
>> alt2is.com/pages_html/openlayers/marker.html
>>
>> Thanks, Tara
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>>
>>
>>
>>
>>  --
>> My e-mail delivery has been unreliable lately, so I am asking for
>> return receipts from all my email messages.
>> OK'ing the return receipt lets me know that my message was delivered.
>> Thank you.
>>
>> Tara Athan
>> Principal, Alternatives to Invasive Species
>> tara_athan at alt2is.com
>> 707-485-1198
>> PO Box 415
>> Redwood Valley, CA 95470
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>>     
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>   




More information about the Users mailing list