Skip to content
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

Closed
minitech opened this issue Jun 3, 2012 · 6 comments
Closed

Draggable markers cause duplication #144

minitech opened this issue Jun 3, 2012 · 6 comments

Comments

@minitech
Copy link
Contributor

minitech commented Jun 3, 2012

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.

@minitech
Copy link
Contributor Author

minitech commented Jun 3, 2012

Sorry, it's the combination of draggable and toProprietary that seems to do it.

@gilesc50
Copy link
Member

gilesc50 commented Aug 3, 2013

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?

@gilesc50 gilesc50 closed this as completed Aug 4, 2013
@minitech
Copy link
Contributor Author

Still reproducible. It needs a toProprietary(). Live demo

<!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>

@gilesc50
Copy link
Member

The issue is happening due to your call of
marker.toProprietary();

what are you trying to achieve with that?

Giles
From: minitech [mailto:notifications@github.com]
Sent: 10 August 2013 16:07
To: mapstraction/mxn
Cc: Giles Collingwood
Subject: Re: [mxn] Draggable markers cause duplication (#144)

Still reproducible. It needs a toProprietary(). Live demohttp://dl.dropboxusercontent.com/u/149981775/bug-reports/mapstraction-duplication-bug.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>


Reply to this email directly or view it on GitHubhttps://github.com//issues/144#issuecomment-22441318.

@minitech
Copy link
Contributor Author

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.

@gilesc50
Copy link
Member

Yep its not meant to be used like that.

Thanks for responding.

Giles

From: minitech [mailto:notifications@github.com]
Sent: 11 August 2013 15:19
To: mapstraction/mxn
Cc: Giles Collingwood
Subject: Re: [mxn] Draggable markers cause duplication (#144)

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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/144#issuecomment-22458366.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants