Hello, I''m a user of mapstraction and I''m having some issues. The provider is openlayers. I have to follow the positions of a fleet of vehicles, which have to be updated in "realtime". I start by placing my set of markers (with icons) at arbitrary position and I set up a "timer" with setInterval which regularly modifies the location attribute of the marker (with data obtained by AJAX/JSON). I delete all the markers and re-add them, be it one by one or all at the same time. The markers are well placed at the new location but at the former place of the markers, the icons still remain. The autoCenterAndZoom function works well on the new locations, it seems that only the drawings (not the markers themselves) remain at the former locations. How can I erase the traces of the old locations ? Thank you for your help. Regards Nicolas CARRIER PS : Please be keen about language, I''m french. And don''t hesitate to correct my mistakes. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100827/700bb853/attachment.htm>
Hi Nicolas, I think there may be a problem with the implementation of removeMarker in mxn.openlayers.js. If the following code works for you, let me know and I''ll submit the fix in the Git repository: removeMarker: function(marker) { var map = this.maps[this.api]; this.layers.markers.removeMarker(marker.proprietary_marker); marker.proprietary_marker.destroy(); }, -dylan- On Fri, Aug 27, 2010 at 9:42 AM, Nicolas CARRIER <carrier.nicolas0 at gmail.com> wrote:> Hello, > I''m a user of mapstraction and I''m having some issues. The provider is > openlayers. > I have to follow the positions of a fleet of vehicles, which have to be > updated in "realtime". > I start by placing my set of markers (with icons) at arbitrary position and > I set up a "timer" with setInterval which regularly modifies the location > attribute of the marker (with data obtained by AJAX/JSON). I delete all the > markers and re-add them, be it one by one or all at the same time. > The markers are well placed at the new location but at the former place of > the markers, the icons still remain. > The autoCenterAndZoom function works well on the new locations, it seems > that only the drawings (not the markers themselves) remain at the former > locations. > > How can I erase the traces of the old locations ? > > Thank you for your help. > > Regards > Nicolas CARRIER > > PS : Please be keen about language, I''m french. And don''t hesitate to > correct my mistakes. > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100827/22397c04/attachment.htm>
Hello, I''ve tried the piece of code you sent me, but I had to add a this.layers.markers.redraw(); to have it work. It seems that the marker is well destroyed and removed but that the drawing remains. So the entire piece of code I replaced removeMarker by is : removeMarker: function(marker) { var map = this.maps[this.api]; this.layers.markers.removeMarker(marker.proprietary_marker); marker.proprietary_marker.destroy(); this.layers.markers.redraw(); }, Thanks a lot for your help. Regards, Nicolas. 2010/8/27 cyberhobo <cyberhobo at cyberhobo.net>> Hi Nicolas, > > I think there may be a problem with the implementation of removeMarker in > mxn.openlayers.js. If the following code works for you, let me know and I''ll > submit the fix in the Git repository: > > removeMarker: function(marker) { > var map = this.maps[this.api]; > this.layers.markers.removeMarker(marker.proprietary_marker); > marker.proprietary_marker.destroy(); > }, > > -dylan- > > On Fri, Aug 27, 2010 at 9:42 AM, Nicolas CARRIER < > carrier.nicolas0 at gmail.com> wrote: > >> Hello, >> I''m a user of mapstraction and I''m having some issues. The provider is >> openlayers. >> I have to follow the positions of a fleet of vehicles, which have to be >> updated in "realtime". >> I start by placing my set of markers (with icons) at arbitrary position >> and I set up a "timer" with setInterval which regularly modifies the >> location attribute of the marker (with data obtained by AJAX/JSON). I delete >> all the markers and re-add them, be it one by one or all at the same time. >> The markers are well placed at the new location but at the former place of >> the markers, the icons still remain. >> The autoCenterAndZoom function works well on the new locations, it seems >> that only the drawings (not the markers themselves) remain at the former >> locations. >> >> How can I erase the traces of the old locations ? >> >> Thank you for your help. >> >> Regards >> Nicolas CARRIER >> >> PS : Please be keen about language, I''m french. And don''t hesitate to >> correct my mistakes. >> >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> >> > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100830/e3549148/attachment.htm>
Hello, This would be better I think : removeMarker: function(marker) { var map = this.maps[this.api]; marker.hide(); this.layers.markers.removeMarker(marker.proprietary_marker); marker.proprietary_marker.destroy(); }, As it only hides the marker before destroying instead of redrawing the entire map. Regards, Nicolas. 2010/8/30 Nicolas CARRIER <carrier.nicolas0 at gmail.com>> Hello, > I''ve tried the piece of code you sent me, but I had to add a > this.layers.markers.redraw(); > to have it work. It seems that the marker is well destroyed and removed but > that the drawing remains. > So the entire piece of code I replaced removeMarker by is : > > removeMarker: function(marker) { > var map = this.maps[this.api]; > this.layers.markers.removeMarker(marker.proprietary_marker); > marker.proprietary_marker.destroy(); > this.layers.markers.redraw(); > }, > Thanks a lot for your help. > Regards, > Nicolas. > > 2010/8/27 cyberhobo <cyberhobo at cyberhobo.net> > > Hi Nicolas, >> >> I think there may be a problem with the implementation of removeMarker in >> mxn.openlayers.js. If the following code works for you, let me know and I''ll >> submit the fix in the Git repository: >> >> removeMarker: function(marker) { >> var map = this.maps[this.api]; >> this.layers.markers.removeMarker(marker.proprietary_marker); >> marker.proprietary_marker.destroy(); >> }, >> >> -dylan- >> >> On Fri, Aug 27, 2010 at 9:42 AM, Nicolas CARRIER < >> carrier.nicolas0 at gmail.com> wrote: >> >>> Hello, >>> I''m a user of mapstraction and I''m having some issues. The provider is >>> openlayers. >>> I have to follow the positions of a fleet of vehicles, which have to be >>> updated in "realtime". >>> I start by placing my set of markers (with icons) at arbitrary position >>> and I set up a "timer" with setInterval which regularly modifies the >>> location attribute of the marker (with data obtained by AJAX/JSON). I delete >>> all the markers and re-add them, be it one by one or all at the same time. >>> The markers are well placed at the new location but at the former place >>> of the markers, the icons still remain. >>> The autoCenterAndZoom function works well on the new locations, it seems >>> that only the drawings (not the markers themselves) remain at the former >>> locations. >>> >>> How can I erase the traces of the old locations ? >>> >>> Thank you for your help. >>> >>> Regards >>> Nicolas CARRIER >>> >>> PS : Please be keen about language, I''m french. And don''t hesitate to >>> correct my mistakes. >>> >>> _______________________________________________ >>> Mapstraction mailing list >>> Mapstraction at lists.mapstraction.com >>> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >>> >>> >> >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100830/a08f34cd/attachment.htm>
Okay, that works for me. I noticed the relic map variable isn''t even used, so I''ll submit this: removeMarker: function(marker) { marker.hide(); this.layers.markers.removeMarker(marker.proprietary_marker); marker.proprietary_marker.destroy(); }, -dylan- On Mon, Aug 30, 2010 at 4:57 AM, Nicolas CARRIER <carrier.nicolas0 at gmail.com> wrote:> Hello, > This would be better I think : > > removeMarker: function(marker) { > var map = this.maps[this.api]; > marker.hide(); > > this.layers.markers.removeMarker(marker.proprietary_marker); > marker.proprietary_marker.destroy(); > }, > > As it only hides the marker before destroying instead of redrawing the > entire map. > > Regards, > Nicolas. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100830/0b39c99d/attachment-0001.htm>
OK great ! But I don''t really know how the development of an open source project works so when will it be released and available for download at the mapstraction website ? I''d rather use the stable released version in the production site than use a version I manually modified. Thanks again, Regards Nicolas 2010/8/30 cyberhobo <cyberhobo at cyberhobo.net>> Okay, that works for me. I noticed the relic map variable isn''t even used, > so I''ll submit this: > > removeMarker: function(marker) { > marker.hide(); > this.layers.markers.removeMarker(marker.proprietary_marker); > marker.proprietary_marker.destroy(); > }, > > -dylan- > > On Mon, Aug 30, 2010 at 4:57 AM, Nicolas CARRIER < > carrier.nicolas0 at gmail.com> wrote: > >> Hello, >> >> This would be better I think : >> >> removeMarker: function(marker) { >> var map = this.maps[this.api]; >> marker.hide(); >> >> this.layers.markers.removeMarker(marker.proprietary_marker); >> marker.proprietary_marker.destroy(); >> }, >> >> As it only hides the marker before destroying instead of redrawing the >> entire map. >> >> Regards, >> Nicolas. >> >> > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100831/89d17a05/attachment.htm>
The process of getting code into a new release is still being fleshed out ( http://wiki.github.com/mapstraction/mxn/contributing), but it looks like it will boil down to the project committers accepting a pull request on github. I''ve submitted the code we agreed on for removeMarker this way, so hopefully it will be in the next release. There was a thread a while back discussing the implications of using the hosted versions of the openlayers scripts as my infobubble implementation does: http://lists.mapstraction.com/htdig.cgi/mapstraction-mapstraction.com/2010-May/000826.html Ultimately, if a few of us ask for code to be included without any objections from others, I imagine it will be. Feel free to coordinate off the list with me if you''d like to work on the infobubble feature together. -dylan- On Tue, Aug 31, 2010 at 1:27 AM, Nicolas CARRIER <carrier.nicolas0 at gmail.com> wrote:> OK great ! > > But I don''t really know how the development of an open source project works > so when will it be released and available for download at the mapstraction > website ? I''d rather use the stable released version in the production site > than use a version I manually modified. > > Thanks again, > Regards > Nicolas > > 2010/8/30 cyberhobo <cyberhobo at cyberhobo.net> > >> Okay, that works for me. I noticed the relic map variable isn''t even >> used, so I''ll submit this: >> >> removeMarker: function(marker) { >> marker.hide(); >> this.layers.markers.removeMarker(marker.proprietary_marker); >> marker.proprietary_marker.destroy(); >> }, >> >> -dylan- >> >> On Mon, Aug 30, 2010 at 4:57 AM, Nicolas CARRIER < >> carrier.nicolas0 at gmail.com> wrote: >> >>> Hello, >>> >>> This would be better I think : >>> >>> removeMarker: function(marker) { >>> var map = this.maps[this.api]; >>> marker.hide(); >>> >>> this.layers.markers.removeMarker(marker.proprietary_marker); >>> marker.proprietary_marker.destroy(); >>> }, >>> >>> As it only hides the marker before destroying instead of redrawing the >>> entire map. >>> >>> Regards, >>> Nicolas. >>> >>> >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> >> > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100831/05676dab/attachment-0001.htm>
very nice, thanks for making this clear and putting it in one place. i look forward to a wave of contributions from all. Nice to see the momentum building. 2010/8/31 cyberhobo <cyberhobo at cyberhobo.net>:> The process of getting code into a new release is still being fleshed out > (http://wiki.github.com/mapstraction/mxn/contributing), but it looks like it > will boil down to the project committers accepting a pull request on github. > I''ve submitted the code we agreed on for removeMarker this way, so hopefully > it will be in the next release. > There was a thread a while back discussing the implications of using the > hosted versions of the openlayers scripts as my infobubble implementation > does:?http://lists.mapstraction.com/htdig.cgi/mapstraction-mapstraction.com/2010-May/000826.html > Ultimately, if a few of us ask for code to be included without any > objections from others, I imagine it will be. > Feel free to coordinate off the list with me if you''d like to work on the > infobubble feature together. > -dylan- > > On Tue, Aug 31, 2010 at 1:27 AM, Nicolas CARRIER > <carrier.nicolas0 at gmail.com> wrote: >> >> OK great ! >> >> But I don''t really know how the development of an open source project >> works so when will it be released and available for download at the >> mapstraction website ? I''d rather use the stable released version in the >> production site than use a version I manually modified. >> >> Thanks again, >> Regards >> Nicolas >> >> 2010/8/30 cyberhobo <cyberhobo at cyberhobo.net> >>> >>> Okay, that works for me. I noticed the relic map variable isn''t even >>> used, so I''ll submit this: >>> removeMarker: function(marker) { >>> marker.hide(); >>> this.layers.markers.removeMarker(marker.proprietary_marker); >>> marker.proprietary_marker.destroy(); >>> }, >>> -dylan- >>> On Mon, Aug 30, 2010 at 4:57 AM, Nicolas CARRIER >>> <carrier.nicolas0 at gmail.com> wrote: >>>> >>>> Hello, >>>> This would be better I think : >>>> ??? ??? removeMarker: function(marker) { >>>> ??? ??? ??? var map = this.maps[this.api]; >>>> ??? ??? ??? marker.hide(); >>>> ??? ??? ??? this.layers.markers.removeMarker(marker.proprietary_marker); >>>> ??? ??? ??? marker.proprietary_marker.destroy(); >>>> ??? ??? }, >>>> >>>> As it only hides the marker before destroying instead of redrawing the >>>> entire map. >>>> >>>> Regards, >>>> Nicolas. >>>> >>> >>> _______________________________________________ >>> Mapstraction mailing list >>> Mapstraction at lists.mapstraction.com >>> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >>> >> >> >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> > > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >