[OpenLayers-Users] Vector&Marker

=?GBK?B?ufnR9NKr?= gistop at 163.com
Thu Nov 10 02:53:48 EST 2011


Hi,guys.I am in trouble.
When I add the vector layer to my map the popup of my marker don't appear correctly.I find the response area become smaller,yes,actually,it is very small so that in order to show a popup I have to click repeatedly.
It works well if not add a Vector.
Thanks in advance.

.........
vectors = new OpenLayers.Layer.Vector("Simple Geometry", {
   style : layer_style
  });
map.addLayer(vectors);
var pointList = [];
for ( var i = 0; i < 50; i++) {
   newPoint = new OpenLayers.Geometry.Point(60 + i, 8 - i);
   pointList.push(newPoint);
  }
lineFeature = new OpenLayers.Feature.Vector(
    new OpenLayers.Geometry.LineString(pointList), null,
    style_green);
vectors.addFeatures([ lineFeature ]);

.....

           
var markerClick = function (evt) {
                if (this.popup == null) {
                    this.popup = this.createPopup(this.closeBox);
                    map.addPopup(this.popup);
                    this.popup.show();
                } else {
                    this.popup.toggle();
                }
                currentPopup = this.popup;
                OpenLayers.Event.stop(evt);
             alert('ok');
            };
            marker.events.register("mousedown", feature, markerClick);
            markers.addMarker(marker);
        }
.....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111110/8242d5d7/attachment.html


More information about the Users mailing list