Hi,
whatever i tried, creating a custom icon did not work. Even cloning the default one, when you change the image path the style is broken.
It seems wrong values are inserted in the database in the 'openlayers_styles' table, 'options' column. Modifying these values via phpmyadmin makes custom styles working normally :
NOT WORKING when creating/modifying style :
a:3:{s:4:"path";s:73:"http://xxxxx/ecv/sites/all/themes/ecv/images/autres.png";s:5:"scale";i:1;s:6:"anchor";a:2:{s:1:"x";d:0.5;s:1:"y";d:0.5;}}
WORKING after manual edit :
a:3:{s:4:"path";s:73:"http://xxxxx/ecv/sites/all/themes/ecv/images/autres.png";s:5:"scale";i:1;s:6:"anchor";a:2:{i:0;d:0.5;i:1;i:1;}}
Thanks
Comments
Comment #2
sgdev commentedThe
optionsFormfunction inicon.phpuses a subarray of 'x' and 'y' for the anchors. To have the array generate correctly, they should be incremental values of 0 and 1. An example can be seen in theopenlayers_examples_default_openlayers_stylesfunction, where theanchorarray has values of 0 and 1, not 'x' and 'y'.Attached is a patch for review. I also edited the scale label to display "Scale" rather than "Path", since this is a typo that needs to be fixed.
Comment #3
sgdev commentedUpdating status.
Comment #4
polThanks!
Comment #5
roman_l commentedThank you very much ron_s !
I'll apply and review the patch today.
Moreover it seems the icon url is inserted in the db as an absolute path :
Just moved my dev site to another server and the icon do not show (Failed to load resource: net::ERR_ADDRESS_UNREACHABLE)
Comment #6
sgdev commented@Pol, this was marked as fixed, but needs to be committed. Thanks!
Comment #7
sgdev commented@piactif, yes as far as I know, this path requires an absolute URL.
Comment #8
m.stentaWas this committed? Changing to Needs Review so it doesn't get closed automatically...
Comment #10
polLooks like I forgot to commit this. Anyway, I just did it now. Sorry for this, it will be included in 3.2.