0

I have to draw complex shapes for representation on OpenLayers map.
On surfing the internet, I found many links that define a points collection for drawing various shapes like an Arrow, a lightning etc...

but none explain how to draw these shapes

example,

OpenLayers.Renderer.symbol.church = [4, 0, 6, 0, 6, 4, 10, 4, 10, 6, 6, 6, 6, 14, 4, 14, 4, 6, 0, 6, 0, 4, 4, 4, 4, 0];

Symbolises a church symbol...

OpenLayers.Renderer.symbol.lightning = [0, 0, 4, 2, 6, 0, 10, 5, 6, 3, 4, 5, 0, 0];

Symbolises a lightning symbol...

But what does these points mean? If I have to draw a callout like shape, then how should I draw it?

llrs
  • 3,308
  • 35
  • 68

2 Answers2

2

Also check this post : https://plus.google.com/104715080777872762852/posts/baRGTS2yFbh It includes a matrix to make it much easier to draw up something.

Knarf
  • 2,077
  • 1
  • 16
  • 24
1

Check out the GWT-OL example : http://demo.gwt-openlayers.org/gwt_ol_showcase/GwtOpenLayersShowcase.html?example=Well%20known%20graphic%20example

About how to read it. You have to read the numbers 2 at a time. The first is the X position, the second is the Y position.

For example (I did at some spacing to make it more clean) (note that this is GWT-OpenLayers code) : int[] points = new int[]{0, 0, 4, 2,};

Will draw a line from point 0,0 to point 4,2. And 0,0 means the upperleft corner.

Or [0,0, 8,0, 8,8, 0,8] represents a square.

Knarf
  • 2,077
  • 1
  • 16
  • 24