0

i´m using the openlayers drawing example inside my mobile JS (qooxdoo) app and all works fine except that the drawing cursor is above the viewport so I can draw but I don´t see the cursor and I can only see the drawing after I scroll down.

I have used this qooxdoo example as a base. I have also added all the css rules from the openlayers example to my qooxdoo styles.

Seems like a css position issue, but I can´t seem to find it.

Any help would be appreciated.

     /**
     * Loads JavaScript library which is needed for the map.
     */
    _loadMapLibrary: function() {

        var self = this;
        var req = new qx.bom.request.Script();

        var options = {
            singleTile: true,
            ratio: 1,
            isBaseLayer: true,
            wrapDateLine: true,
            getURL: function() {
                var center = self._map.getCenter().transform("EPSG:3857", "EPSG:4326"),
                    size = self._map.getSize();
                return [
                this.url, "&center=", center.lat, ",", center.lon, "&zoom=", self._map.getZoom(), "&size=", size.w, "x", size.h].join("");
            }
        };

        req.onload = function() {
            var vector = new OpenLayers.Layer.Vector('Vector Layer', {
                styleMap: new OpenLayers.StyleMap({
                    temporary: OpenLayers.Util.applyDefaults({
                        pointRadius: 16
                    }, OpenLayers.Feature.Vector.style.temporary)
                })
            });

            // OpenLayers' EditingToolbar internally creates a Navigation control, we
            // want a TouchNavigation control here so we create our own editing toolbar
            var toolbar = new OpenLayers.Control.Panel({
                displayClass: 'olControlEditingToolbar'
            });
            toolbar.addControls([
            // this control is just there to be able to deactivate the drawing
            // tools
            new OpenLayers.Control({
                displayClass: 'olControlNavigation'
            }), new OpenLayers.Control.ModifyFeature(vector, {
                vertexRenderIntent: 'temporary',
                displayClass: 'olControlModifyFeature'
            }), new OpenLayers.Control.DrawFeature(vector, OpenLayers.Handler.Point, {
                displayClass: 'olControlDrawFeaturePoint'
            }), new OpenLayers.Control.DrawFeature(vector, OpenLayers.Handler.Path, {
                displayClass: 'olControlDrawFeaturePath'
            }), new OpenLayers.Control.DrawFeature(vector, OpenLayers.Handler.Polygon, {
                displayClass: 'olControlDrawFeaturePolygon'
            })]);

            var osm = new OpenLayers.Layer.OSM();
            osm.wrapDateLine = false;

            map = new OpenLayers.Map({
                div: 'googleMap',
                projection: 'EPSG:900913',
                numZoomLevels: 18,
                controls: [
                new OpenLayers.Control.TouchNavigation({
                    dragPanOptions: {
                        enableKinetic: true
                    }
                }), new OpenLayers.Control.Zoom(), toolbar],
                layers: [osm, vector],
                center: new OpenLayers.LonLat(0, 0),
                zoom: 1,
                theme: null
            });

            // activate the first control to render the "navigation icon"
            // as active
            toolbar.controls[0].activate();
        }

        req.open("GET", this._mapUri);
        req.send();
    },
ThomasH
  • 22,276
  • 13
  • 61
  • 62
E_lexy
  • 141
  • 6

1 Answers1

0

Please check the z-Index of the cursor's class. The best way is to modify the z-Index through Chrome's debugger console or Firebug.

Is there any live example of your application available?

czuendorf
  • 853
  • 6
  • 9