I am trying to build a web application for iPad using OpenLayers Mobile. One of the features it should have is that you can tap on a tree displayed on a basemap and get information about this tree. These trees are provided through a WMS service in GeoServer and the info should be displayed in a popup.

In the standard version of OpenLayers I would use WMSGetFeatureInfo to achieve this, but this seems not to be working with the mobile version.

When using OpenLayers mobile, I get an error message saying:

TypeError: OpenLayers.Control.WMSGetFeatureInfo is not a constructor

Can you help me fix this?


1 Answer 1


If the OpenLayers.mobile.js build doesn't contain the controls you want to use (as it seems is the case in your example), but you don't want to use the full OpenLayers.js build because it is too verbose for a mobile application, then the solution is build your own custom version.

See Deploying (Shipping OpenLayers 2 in your Application) for details of how to create a custom build of OpenLayers 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.