[OpenLayers-Users] How to replace country color with image ?

Jerome Freyre jerome.freyre at hispeed.ch
Tue Sep 1 02:06:07 EDT 2009


Hi Jan,

I search for a solution but without success... I tried some scripts  
but it was the same result... nothing!

I think it is not possible to define a background picture for a  
polygon but only for features like points...

And unfortunately, I have no other options for now ...

Best regards,
Jérome


Le 31 août 09 à 14:37, Jan.Sørensen (via Nabble) a écrit :

> Hi Jerome,
>
> Thanks for the reply.
> I tried using the externalGraphic, but without much success.
> The code is as follows:
>
> var stylemap = new OpenLayers.StyleMap({externalGraphic: '/images/ 
> country.jpg'});
>
> in my _buildStyle function where I define theme and rules  
> respectively.
>
> The problem is that when I define colors for onSelect event its ok:
>
> var stylemap = new OpenLayers.StyleMap({'default':theme, 'select':  
> {'strokeColor': '#59bce6', 'fillColor': '#59bce6', 'strokeWidth':  
> 1}});
>
> I read this sample: http://docs.openlayers.org/library/feature_styling.html
> and the only difference is that I am using GML instead of vectors.
>
> Could that be the problem ?
>
> Cheers,
> js
>
> Jerome Freyre wrote:
> Hi Jan,
>
> maybe you can use the property
>
> externalGraphic : myStaticImage
>
> in the style definition
>
> Sincerly,
> Jérome
>
>
> Jan.Sørensen wrote:
> Hi,
>
> I'm pretty new to Open Layers, so probably I'm looking for something  
> obvious :)
>
> I want to fill country with instead of a color with a static image
> Up to now I have a default style that upon mouse over I successfully  
> changes color of the country that mouse cursor is currently on.
>
> Anyone can give me a shot ?
>
> Cheers,
> JS
>
>
> View message @ http://n2.nabble.com/How-to-replace-country-color-with-image-tp3551757p3553141.html
> To unsubscribe from Re: How to replace country color with image ?,  
> click here.
>


-- 
View this message in context: http://n2.nabble.com/How-to-replace-country-color-with-image-tp3551757p3558592.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090901/1a2c0afd/attachment.html


More information about the Users mailing list