adding test for removeMarker()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@518 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
var map, layer, popup;
|
var map, layer, popup;
|
||||||
var markers, feature;
|
var markers, feature, marker;
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
@@ -62,14 +62,14 @@
|
|||||||
new OpenLayers.LonLat(0,0));
|
new OpenLayers.LonLat(0,0));
|
||||||
|
|
||||||
|
|
||||||
var marker = feature.createMarker();
|
marker = feature.createMarker();
|
||||||
|
|
||||||
markers.addMarker(marker);
|
markers.addMarker(marker);
|
||||||
marker.events.register("mousedown", marker, mousedown);
|
marker.events.register("mousedown", marker, mousedown);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mousedown() {
|
function mousedown(evt) {
|
||||||
if (popup == null) {
|
if (popup == null) {
|
||||||
popup = feature.createPopup();
|
popup = feature.createPopup();
|
||||||
popup.setBackgroundColor("yellow");
|
popup.setBackgroundColor("yellow");
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function remove() {
|
function remove() {
|
||||||
map.removePopup(popup);
|
markers.removeMarker(marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user