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 creating a openlayers map, to insert points, and i have some controls in the map like: to move point, to delete a point and to select a point. i have a problem that i cant select a point (with all the controls) when i first loading the map, for select i have to zoomin/zoomout and only then its works. i checked my code like 100 times and i cant see the problem. maybe i need to active something when the map loading? this is the controls:

 controls = {
        point: new OpenLayers.Control.DrawFeature(vectors,
                    OpenLayers.Handler.Point, { featureAdded: onCompletAdd }),
        line: new OpenLayers.Control.DrawFeature(vectors,
                    OpenLayers.Handler.Path, { featureAdded: onCompleteMove }),
        polygon: new OpenLayers.Control.DrawFeature(vectors,
                    OpenLayers.Handler.Polygon, { featureAdded: onCompleteMove }),
        regular: new OpenLayers.Control.DrawFeature(vectors,
                    OpenLayers.Handler.RegularPolygon,
                    { handlerOptions: { sides: 5} }, { featureAdded: onCompleteMove }),
        select: new OpenLayers.Control.SelectFeature(
            vectors,
            {
                clickout: true, toggle: false,
                multiple: false, hover: false,
                toggleKey: "ctrlKey", // ctrl key removes from selection
                multipleKey: "shiftKey", // shift key adds to selection
                box: false
            }
        ),
        modify: new OpenLayers.Control.ModifyFeature(vectors, { onModificationEnd: onCompleteMove }),
        deletef: new OpenLayers.Control.SelectFeature(vectors, {
            clickout: false,
            box: true,
            toggle: false,
            title: "Delete"
        })
    };

what can it be?

share|improve this question
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.