-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draggable markers cause duplication #144
Comments
Sorry, it's the combination of |
I can't reproduce this on the latest release 3 branch. I added marker.setDraggable(true); to the examples\googlev3.html inside the addmarker function as the second line, and I can now drag the marker all round the map and I only ever see 1. Can you provide an example gist for this please? |
Still reproducible. It needs a <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Mapstraction Bug Test</title>
<style type="text/css">
#map {
background-color: #eee;
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript" src="http://dev.openlayers.org/releases/OpenLayers-2.9.1/OpenLayers.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://mapstraction.com/mxn/build/latest/mxn.js?(googlev3,openlayers)"></script>
<script type="text/javascript">
var map = new mxn.Mapstraction('map', 'googlev3');
var latlon = new mxn.LatLonPoint(39.74, -104.98);
map.setCenterAndZoom(latlon, 10);
var marker = new mxn.Marker(new mxn.LatLonPoint(39.74, -104.98));
marker.setDraggable(true);
map.addMarker(marker);
marker.toProprietary();
</script>
</body>
</html> |
The issue is happening due to your call of what are you trying to achieve with that? Giles Still reproducible. It needs a toProprietary(). Live demohttp://dl.dropboxusercontent.com/u/149981775/bug-reports/mapstraction-duplication-bug.html
— |
Yes, I get that. I’m not trying to achieve anything with |
Yep its not meant to be used like that. Thanks for responding. Giles From: minitech [mailto:notifications@github.com] Yes, I get that. I’m not trying to achieve anything with toProprietary now. I left the thing I was working on over a year ago. But I’d say this is a bug with toProprietary, unless that’s just not meant to be used. — |
The first time a marker is dragged, it gets duplicated. A marker isn't added to the
map.markers
array, it just appears on the map as the one being dragged and doesn't affect the other marker. Once this has happened, the original marker can be dragged again without anything breaking, but there are still two markers. This only happens with the Google v3 API.The text was updated successfully, but these errors were encountered: