Custom OpenLayer Control

Today I decided to write a small tutorial on how to write a custom control in Openlayers (2.x) that can identify a wfs feature without the wfs being displayed in the map.
The data I am working are mainly polygons, they cover the whole area that the project focuses because they obey a basic topology (no overlapping and no gaps).

  • Step: One
  • we have to name our control, so I choose the obvious name Identify

  • Step: Two
  • what is important is to write the initialize function and decide what handler our control will use, OpenLayers has several handlers that one can use. In this Controls we will use the Click Handler because we need the user to click and map also we need to define some default options for it

(more…)