Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to minimize my code by modifying OpenLayers deploy configuration file in order to reduce its load time. However, It seems that I can't include all necessary libs that OpenLayers.SelectFeature.Control needs. Here is the config file:

    [include]
OpenLayers/Map.js
OpenLayers/Kinetic.js
OpenLayers/Projection.js
OpenLayers/Handler.js
OpenLayers/Control.js
OpenLayers/BaseTypes/Pixel.js
OpenLayers/BaseTypes/LonLat.js
OpenLayers/BaseTypes/Bounds.js
OpenLayers/Layer/SphericalMercator.js
OpenLayers/Layer/XYZ.js
OpenLayers/Layer/WMS.js
OpenLayers/Layer/Vector.js
OpenLayers/Layer/ArcGISCache.js
OpenLayers/Control/TouchNavigation.js
OpenLayers/Control/Geolocate.js
OpenLayers/Control/Attribution.js
OpenLayers/Control/SelectFeature.js
OpenLayers/Control/DrawFeature.js
OpenLayers/Control/ModifyFeature.js
OpenLayers/Control/Snapping.js
OpenLayers/Control/Split.js
OpenLayers/Control/Panel.js
OpenLayers/Control/Button.js
OpenLayers/Control/PinchZoom.js
OpenLayers/Feature/Vector.js
OpenLayers/Feature/WFS.js
OpenLayers/Handler/Click.js
OpenLayers/Handler/Feature.js
OpenLayers/Handler/Hover.js
OpenLayers/Handler/Box.js
OpenLayers/Renderer/SVG.js
OpenLayers/Renderer/Canvas.js
OpenLayers/Format/GeoJSON.js
OpenLayers/Format/KML.js
OpenLayers/Format/WFS.js
OpenLayers/Format/WFSCapabilities.js
OpenLayers/Format/WFSCapabilities/v1.js
OpenLayers/Format/WFSCapabilities/v1_0_0.js
OpenLayers/Format/WFSCapabilities/v1_1_0.js
OpenLayers/Format/WFSDescribeFeatureType.js
OpenLayers/Format/XML.js
OpenLayers/Request/XMLHttpRequest.js
OpenLayers/Protocol/HTTP.js
OpenLayers/Protocol/WFS.js
OpenLayers/Protocol/WFS/v1.js
OpenLayers/Protocol/WFS/v1_0_0.js
OpenLayers/Protocol/WFS/v1_1_0.js
OpenLayers/Strategy/Fixed.js
OpenLayers/Strategy/BBOX.js

When I test selectFeature feature which has a feature info popup in OnSelect, it always tells me following error:

cannot call "add" of undefined

which I think it points out that in the file of selectFeature.js, under "pixelToBounds", the variable "pixel" is undefined, and then I assume it's relevant to the recognition of "evt".

could somebody give me some hints?

thank you!

share|improve this question

1 Answer 1

if you check out the code of selectFeature Control, you can see requiring files as following:

/**
 * @requires OpenLayers/Control.js
 * @requires OpenLayers/Feature/Vector.js
 * @requires OpenLayers/Handler/Feature.js
 * @requires OpenLayers/Layer/Vector/RootContainer.js
 */

i hope it helps you...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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