Hugo Estrada
2009-Jun-02 02:36 UTC
[Mapstraction] Mapstraction v2 delete removeAllMarkers from mxn.(provider).core.js ?
I ran into an interesting thing in the code while trying to implement removeAllMarkers for microsoft. Microsoft''s api lacks a method to remove all markers because markers are just a type of VEshape. While digging through the core, I noticed that a method had already been written that seems to be agnostic to any specific api. I tested it with virtual earth, and it worked beautifully. So, is there a reason to keep it in the template for providers? Doesn''t it make more sense to just take it out from it? Of course, I just started contributing, so there may be a reason that I am not familiar with :) Hugo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20090601/7a17cf83/attachment.htm>
Adam DuVander
2009-Jun-02 07:44 UTC
[Mapstraction] Mapstraction v2 delete removeAllMarkers from mxn.(provider).core.js ?
Huge -- I ran into the same thing with my Cloudmade implementation. It''s a neat feeling to have the removeAllMarkers function without having written it. I ended up just with an empty function, though removing it may be better. My feeling is that we should probably keep it in the template, because it''s probably best to use a provider''s removeAll function if one exists. I imagine most providers that have the function will have a more efficient way of removing all markers than iterating through the markers. --Adam --- Adam DuVander I like maps: http://mapscripting.com I like simple: http://adamduvander.com On Jun 1, 2009, at 7:36 PM, Hugo Estrada wrote:> I ran into an interesting thing in the code while trying to > implement removeAllMarkers for microsoft. Microsoft''s api lacks a > method to remove all markers because markers are just a type of > VEshape. While digging through the core, I noticed that a method had > already been written that seems to be agnostic to any specific api. > I tested it with virtual earth, and it worked beautifully. > > So, is there a reason to keep it in the template for providers? > Doesn''t it make more sense to just take it out from it? > > Of course, I just started contributing, so there may be a reason > that I am not familiar with :) > > Hugo > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com
pamela fox
2009-Jun-02 07:46 UTC
[Mapstraction] Mapstraction v2 delete removeAllMarkers from mxn.(provider).core.js ?
I can tell you the Google Maps API''s clearOverlays() function is purely a for loop that calls removeOverlay() on each marker, and we''ve removed that method in API v3 since it seems unnecessary for us to provide it ourselves. On Tue, Jun 2, 2009 at 12:44 AM, Adam DuVander <mapstraction at duvander.com> wrote:> Huge -- > > I ran into the same thing with my Cloudmade implementation. It''s a neat > feeling to have the removeAllMarkers function without having written it. > > I ended up just with an empty function, though removing it may be better. My > feeling is that we should probably keep it in the template, because it''s > probably best to use a provider''s removeAll function if one exists. I > imagine most providers that have the function will have a more efficient way > of removing all markers than iterating through the markers. > > --Adam > --- > Adam DuVander > I like maps: http://mapscripting.com > I like simple: http://adamduvander.com > > On Jun 1, 2009, at 7:36 PM, Hugo Estrada wrote: > >> I ran into an interesting thing in the code while trying to implement >> removeAllMarkers for microsoft. Microsoft''s api lacks a method to remove all >> markers because markers are just a type of VEshape. While digging through >> the core, I noticed that a method had already been written that seems to be >> agnostic to any specific api. I tested it with virtual earth, and it worked >> beautifully. >> >> So, is there a reason to keep it in the template for providers? Doesn''t it >> make more sense to just take it out from it? >> >> Of course, I just started contributing, so there may be a reason that I am >> not familiar with :) >> >> Hugo >> _______________________________________________ >> 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 >
Adam DuVander
2009-Jun-02 07:52 UTC
[Mapstraction] Mapstraction v2 delete removeAllMarkers from mxn.(provider).core.js ?
You''ve burst my efficiency bubble, Pamela! Hugo--sorry I called you "huge." I think I''ve stayed up too late. --- Adam DuVander I like maps: http://mapscripting.com I like simple: http://adamduvander.com On Jun 2, 2009, at 12:46 AM, pamela fox wrote:> I can tell you the Google Maps API''s clearOverlays() function is > purely a for loop that calls removeOverlay() on each marker, and we''ve > removed that method in API v3 since it seems unnecessary for us to > provide it ourselves. > > > On Tue, Jun 2, 2009 at 12:44 AM, Adam DuVander > <mapstraction at duvander.com> wrote: >> Huge -- >> >> I ran into the same thing with my Cloudmade implementation. It''s a >> neat >> feeling to have the removeAllMarkers function without having >> written it. >> >> I ended up just with an empty function, though removing it may be >> better. My >> feeling is that we should probably keep it in the template, because >> it''s >> probably best to use a provider''s removeAll function if one exists. I >> imagine most providers that have the function will have a more >> efficient way >> of removing all markers than iterating through the markers. >> >> --Adam >> --- >> Adam DuVander >> I like maps: http://mapscripting.com >> I like simple: http://adamduvander.com >> >> On Jun 1, 2009, at 7:36 PM, Hugo Estrada wrote: >> >>> I ran into an interesting thing in the code while trying to >>> implement >>> removeAllMarkers for microsoft. Microsoft''s api lacks a method to >>> remove all >>> markers because markers are just a type of VEshape. While digging >>> through >>> the core, I noticed that a method had already been written that >>> seems to be >>> agnostic to any specific api. I tested it with virtual earth, and >>> it worked >>> beautifully. >>> >>> So, is there a reason to keep it in the template for providers? >>> Doesn''t it >>> make more sense to just take it out from it? >>> >>> Of course, I just started contributing, so there may be a reason >>> that I am >>> not familiar with :) >>> >>> Hugo >>> _______________________________________________ >>> 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 >>
Andrew Turner
2009-Jun-02 11:42 UTC
[Mapstraction] Mapstraction v2 delete removeAllMarkers from mxn.(provider).core.js ?
On Tue, Jun 2, 2009 at 3:46 AM, pamela fox <pammyla.fox at gmail.com> wrote:> I can tell you the Google Maps API''s clearOverlays() function is > purely a for loop that calls removeOverlay() on each marker, and we''ve > removed that method in API v3 since it seems unnecessary for us to > provide it ourselves.ooh, all the more reason for developers to be using Mapstraction! Consistent interfaces ;)> > > On Tue, Jun 2, 2009 at 12:44 AM, Adam DuVander > <mapstraction at duvander.com> wrote: >> Huge -- >> >> I ran into the same thing with my Cloudmade implementation. It''s a neat >> feeling to have the removeAllMarkers function without having written it. >> >> I ended up just with an empty function, though removing it may be better. My >> feeling is that we should probably keep it in the template, because it''s >> probably best to use a provider''s removeAll function if one exists. I >> imagine most providers that have the function will have a more efficient way >> of removing all markers than iterating through the markers. >> >> --Adam >> --- >> Adam DuVander >> I like maps: http://mapscripting.com >> I like simple: http://adamduvander.com >> >> On Jun 1, 2009, at 7:36 PM, Hugo Estrada wrote: >> >>> I ran into an interesting thing in the code while trying to implement >>> removeAllMarkers for microsoft. Microsoft''s api lacks a method to remove all >>> markers because markers are just a type of VEshape. While digging through >>> the core, I noticed that a method had already been written that seems to be >>> agnostic to any specific api. I tested it with virtual earth, and it worked >>> beautifully. >>> >>> So, is there a reason to keep it in the template for providers? Doesn''t it >>> make more sense to just take it out from it? >>> >>> Of course, I just started contributing, so there may be a reason that I am >>> not familiar with :) >>> >>> Hugo >>> _______________________________________________ >>> 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 >-- Andrew Turner mobile: 248.982.3609 andrew at fortiusone.com http://highearthorbit.com http://geocommons.com Helping build the Geospatial Web Introduction to Neogeography - http://oreilly.com/catalog/neogeography
Derek Fowler
2009-Jun-02 23:50 UTC
[Mapstraction] Mapstraction v2 delete removeAllMarkers from mxn.(provider).core.js ?
Yeah, I just left that in thinking "provider implementation might be nicer" but it''s such a simple case that the provider one may even be worse :S I think we need to be sure to remove any empty method stubs from implementations as if we enable the fallback functionality for some core method in the future the presence of a provider method will stop it working. Derek On Tue, Jun 2, 2009 at 12:42 PM, Andrew Turner <andrew at highearthorbit.com>wrote:> On Tue, Jun 2, 2009 at 3:46 AM, pamela fox <pammyla.fox at gmail.com> wrote: > > I can tell you the Google Maps API''s clearOverlays() function is > > purely a for loop that calls removeOverlay() on each marker, and we''ve > > removed that method in API v3 since it seems unnecessary for us to > > provide it ourselves. > > ooh, all the more reason for developers to be using Mapstraction! > Consistent interfaces ;) > > > > > > > > On Tue, Jun 2, 2009 at 12:44 AM, Adam DuVander > > <mapstraction at duvander.com> wrote: > >> Huge -- > >> > >> I ran into the same thing with my Cloudmade implementation. It''s a neat > >> feeling to have the removeAllMarkers function without having written it. > >> > >> I ended up just with an empty function, though removing it may be > better. My > >> feeling is that we should probably keep it in the template, because it''s > >> probably best to use a provider''s removeAll function if one exists. I > >> imagine most providers that have the function will have a more efficient > way > >> of removing all markers than iterating through the markers. > >> > >> --Adam > >> --- > >> Adam DuVander > >> I like maps: http://mapscripting.com > >> I like simple: http://adamduvander.com > >> > >> On Jun 1, 2009, at 7:36 PM, Hugo Estrada wrote: > >> > >>> I ran into an interesting thing in the code while trying to implement > >>> removeAllMarkers for microsoft. Microsoft''s api lacks a method to > remove all > >>> markers because markers are just a type of VEshape. While digging > through > >>> the core, I noticed that a method had already been written that seems > to be > >>> agnostic to any specific api. I tested it with virtual earth, and it > worked > >>> beautifully. > >>> > >>> So, is there a reason to keep it in the template for providers? Doesn''t > it > >>> make more sense to just take it out from it? > >>> > >>> Of course, I just started contributing, so there may be a reason that I > am > >>> not familiar with :) > >>> > >>> Hugo > >>> _______________________________________________ > >>> 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 > > > > > > -- > Andrew Turner > mobile: 248.982.3609 > andrew at fortiusone.com > http://highearthorbit.com > > http://geocommons.com Helping build the Geospatial Web > Introduction to Neogeography - http://oreilly.com/catalog/neogeography > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >-- Derek Fowler m. +44 (0) 7966 512 369 e. dezfowler at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20090603/d00f8dc9/attachment.htm>