chellymehdi / vopenlayers

Automatically exported from code.google.com/p/vopenlayers
0 stars 0 forks source link

support for marker offsets (with working patch) #124

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Submitted in attachment a patch that adds support for offsets on custom marker 
icons.

It was created on the trunk checkout (1.3.1-SNAPSHOT) r218.

Please commit these changes to the trunk, so this feature will be present in 
the next release. My code is free of claims (feel free to do whatever with it).

Original issue reported on code.google.com by tim.bruy...@gmail.com on 5 Apr 2013 at 1:30

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

Good job! 

I didn't yet test the code, but shouldn't methods without offset use 
Integer.MIN_VALUE instead of -1? If you have a test case for the issue, please 
also include that in e.g. this kind of from:
http://code.google.com/p/vopenlayers/source/browse/trunk/src/test/java/org/vaadi
n/vol/demo/ExtentChange.java

cheers,
matti

Original comment by ma...@vaadin.com on 16 Apr 2013 at 2:29

GoogleCodeExporter commented 8 years ago
Hi matti,

you are absolutely right. I started out using -1, but changed it to 
Integer.MIN_VALUE because usable offsets are often negative to start with. I 
forgot to update the rest of the code (duh).

The anchor point of an openlayers marker icon is at (0,0) and openlayers uses 
(-w/2,-h) as the default offset. As such, it was wrong to use -1 as the invalid 
value. In fact, openlayers allows any arbitrary numeric value as offset 
coordinate. However, I suppose using Integer.MIN_VALUE is OK as it is useless 
in practice.

I included an updated patch and also added an example that uses this offset. If 
you have more questions or remarks, then let me know.

Regards,
Tim.

Original comment by tim.bruy...@gmail.com on 16 Apr 2013 at 7:40

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r230.

Original comment by ma...@vaadin.com on 19 Apr 2013 at 1:04