I'm setting the dynamic style in an overlay loading an image stored in a taxonomy field.
I have a field with the image and I set the field style to 'Openlayers Style'. In the overlay settings I then set that field as style field.
I can see the image in the map with the style specified in the field as expected, but when there is more than one point the displayed image is the same for every point. The image loaded is the one in the first row.
In the view preview I can see a new field 'style' like that:
'style' =>
array (
'pointRadius' => 6,
'fillColor' => '#EE9900',
'strokeColor' => '#EE9900',
'strokeWidth' => 1,
'fillOpacity' => 1,
'strokeOpacity' => 1,
'strokeLinecap' => 'round',
'strokeDashstyle' => 'solid',
'graphicWidth' => 32,
'graphicHeight' => 37,
'graphicOpacity' => 1,
'labelAlign' => 'cm',
'externalGraphic' => 'http://sentieri.dev/sites/default/files/intgeo_home-2.png',
),
'wkt' => 'POINT (8.8875 39.1439)',
)
The field with the image is correctly loaded in the preview, but the value for 'externalGraphic' is the same for all rows.
Thanks
Filippo
Comments
Comment #1
filippo.ledda commentedComment #2
filippo.ledda commentedComment #3
polWe are no more using OpenLayers Style for images. Upgrade to the latest beta or dev version please.
Comment #4
filippo.ledda commentedI'm actually using the beta 9. I tried the latest dev but had another bigger issue with layers. Are you planning to abandon the style field as well? The error seems there, as the field is shows the correct value. I'll try a clean installation. Thanks for the rapid answer.
Comment #5
filippo.ledda commentedI've tried with a clean installation with openlayers 7.x-2.0-beta9.
The source style field used was now a text field with the path of the image to use as marker. I experienced the same error mentioned, with all rows having the same value. The value was actually the one from the last row.
I can also confirm that openlayers style is still there for the images, is there something I'm missing?
Comment #6
polComment #7
polSorry my mistake, OpenLayers Beta 9 is still having some bad leftovers of the latest changes I did in OpenLayers Views.
Update to the latest dev version, it's better.
Comment #8
filippo.ledda commentedI see the feature of the style field has been removed. I think it was a great feature; with the last dev we are back to the style with the token, more difficult to configure, also because views doesn't have the feature to print the url of an image.
Thanks for your support.
Comment #9
polYou're perfectly right.
I suggest you to use Image URL Formatter, it does a better job and then use token ;-)
If you want dynamic resizing of your picture, use Image With & Height Formatter and use tokens too.
These modules are listed on the openlayers project page too.
It may be longer to configure, but in the end, it's more powerful.
If you need help, just reopen.