Issue with removeMarker

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with removeMarker

Glen Stampoultzis-2
None of my recent messages to this list have made it through as far as I know.  Hope this one makes it.

The removeMarker call in Markers.js assumes internal knowledge about OpenLayer.Icon.  Since I've created my own version of Icon which doesn't have the same structure this function fails:

    /**
     * @param {OpenLayers.Marker} marker
     */
    removeMarker: function(marker) {
        OpenLayers.Util.removeItem(this.markers, marker);
        if ((marker.icon != null) && ( marker.icon.imageDiv != null) &&
            (marker.icon.imageDiv.parentNode == this.div) ) {
            this.div.removeChild(marker.icon.imageDiv);
        }
    },

Perhaps this should be moved onto the Icon.js so it can clean itself up?




_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with removeMarker

Erik Uzureau-3
Thanks for the tip on this Glen. I think you're very right.
I've made a ticket:
http://trac.openlayers.org/ticket/818

If someone wants to make a patch they are welcome. If not, it's on my
queue of things to do.

Erik

On 6/18/07, Glen Stampoultzis <[hidden email]> wrote:

> None of my recent messages to this list have made it through as far as I
> know.  Hope this one makes it.
>
> The removeMarker call in Markers.js assumes internal knowledge about
> OpenLayer.Icon.  Since I've created my own version of Icon which doesn't
> have the same structure this function fails:
>
>     /**
>      * @param {OpenLayers.Marker} marker
>      */
>     removeMarker: function(marker) {
>         OpenLayers.Util.removeItem(this.markers, marker);
>         if ((marker.icon != null) && ( marker.icon.imageDiv != null) &&
>             (marker.icon.imageDiv.parentNode == this.div) ) {
>             this.div.removeChild(marker.icon.imageDiv);
>         }
>     },
>
> Perhaps this should be moved onto the Icon.js so it can clean itself up?
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>
>
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users