Hey folks, I''m new to this list and am the new maintainer of the Mapstraction Drupal module. Working on my first implementation using v2, and I''m inconsistently getting the following error in Chrome and Safari, which prevents the map from rendering.> /mxn.core.js:6 ReferenceError: Can''t find variable: mxnThe line in question is> /** > * @exports mxn.util.$m as $m > */ > var $m = mxn.util.$m;Any ideas? Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos
Derek Fowler
2010-Feb-18 22:28 UTC
[Mapstraction] ReferenceError: Can''t find variable: mxn
Are you including the main mxn.js file before core? On Feb 18, 2010 8:55 PM, "Lev Tsypin" <lev at levelos.com> wrote: Hey folks, I''m new to this list and am the new maintainer of the Mapstraction Drupal module. Working on my first implementation using v2, and I''m inconsistently getting the following error in Chrome and Safari, which prevents the map from rendering.> /mxn.core.js:6 ReferenceError: Can''t find variable: mxnThe line in question is> /** > * @exports mxn.util.$m as $m > */ > var $m = mxn.util.$m;Any ideas? Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos _______________________________________________ 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/20100218/a8ba5348/attachment.htm>
Yep, my embed code in the header basically looks like this,> <script src="/sites/maps.lcrep.org/modules/contrib/mapstraction/mapstraction/source/mxn.js?(google)" type="text/javascript"></script>I think I may have a lead, though. I was adding the provider specific javascript in the body of the page not the header. That''s the way the module I inherited was doing it, and I didn''t think much of it. At least part of the page could load then in the case the provider was down. But moving the Google Map script to the header (below), above the mxn core script file, made the problem go away. Need to test more.> <script src="http://maps.google.com/maps?file=api&v=2&key=" type="text/javascript"></script>On Feb 18, 2010, at 2:28 PM, Derek Fowler wrote:> Are you including the main mxn.js file before core? > > >Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100218/64c1540a/attachment.htm>
Never mind, that doesn''t solve the problem at all. Completely broken in Chrome and Safari. The relevant portion of my page header looks like this:> <head> > <script src="http://maps.google.com/maps?file=api&v=2&key=***" type="text/javascript"></script> > <script src="/mapstraction/source/mxn.js?(google)" type="text/javascript"></script> > ...Unless I''m doing something wrong, seems like a huge issue. Anyone have ideas? For that matter, are there any live sites using v2 I can use a reference? On Feb 18, 2010, at 2:31 PM, Lev Tsypin wrote:> Yep, my embed code in the header basically looks like this, >> <script src="/sites/maps.lcrep.org/modules/contrib/mapstraction/mapstraction/source/mxn.js?(google)" type="text/javascript"></script> > > I think I may have a lead, though. I was adding the provider specific javascript in the body of the page not the header. That''s the way the module I inherited was doing it, and I didn''t think much of it. At least part of the page could load then in the case the provider was down. But moving the Google Map script to the header (below), above the mxn core script file, made the problem go away. Need to test more. >> <script src="http://maps.google.com/maps?file=api&v=2&key=" type="text/javascript"></script> > > On Feb 18, 2010, at 2:28 PM, Derek Fowler wrote: > >> Are you including the main mxn.js file before core?Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos
Adam DuVander
2010-Feb-19 02:26 UTC
[Mapstraction] ReferenceError: Can''t find variable: mxn
I''m wondering if this is related to some of the auto-loading issues in Webkit? If you load core and individual provider libraries explicitly, that will likely solve the issue. In other words: <script src="http://maps.google.com/maps?file=api&v=2&key=***" type="text/javascript"></script> <script src="/mapstraction/source/mxn.core.js" type="text/javascript"></script> <script src="/mapstraction/source/mxn.google.js" type="text/javascript"></script> I think it''s preferable to auto-load, as you have, but this could help determine where the error lies. --Adam --- Adam DuVander I like maps: http://mapscripting.com I like simple: http://adamduvander.com On Feb 18, 2010, at 3:20 PM, Lev Tsypin wrote:> Never mind, that doesn''t solve the problem at all. Completely broken in Chrome and Safari. The relevant portion of my page header looks like this: >> <head> >> <script src="http://maps.google.com/maps?file=api&v=2&key=***" type="text/javascript"></script> >> <script src="/mapstraction/source/mxn.js?(google)" type="text/javascript"></script> >> ... > > Unless I''m doing something wrong, seems like a huge issue. Anyone have ideas? For that matter, are there any live sites using v2 I can use a reference? > > On Feb 18, 2010, at 2:31 PM, Lev Tsypin wrote: > >> Yep, my embed code in the header basically looks like this, >>> <script src="/sites/maps.lcrep.org/modules/contrib/mapstraction/mapstraction/source/mxn.js?(google)" type="text/javascript"></script> >> >> I think I may have a lead, though. I was adding the provider specific javascript in the body of the page not the header. That''s the way the module I inherited was doing it, and I didn''t think much of it. At least part of the page could load then in the case the provider was down. But moving the Google Map script to the header (below), above the mxn core script file, made the problem go away. Need to test more. >>> <script src="http://maps.google.com/maps?file=api&v=2&key=" type="text/javascript"></script> >> >> On Feb 18, 2010, at 2:28 PM, Derek Fowler wrote: >> >>> Are you including the main mxn.js file before core? > > Lev Tsypin > _____________________ > Level Online Strategy, LLC > 503.342.8044 > levelos.com | twitter.com/levelos > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com
That''s actually what I did and it seems to have fixed the problem, thanks Adam. Does that mean no auto-load, or there is a fix that can be made? I haven''t heard about this issue before. On Feb 18, 2010, at 6:26 PM, Adam DuVander wrote:> I''m wondering if this is related to some of the auto-loading issues in Webkit? > > If you load core and individual provider libraries explicitly, that will likely solve the issue. In other words: > <script src="http://maps.google.com/maps?file=api&v=2&key=***" type="text/javascript"></script> > <script src="/mapstraction/source/mxn.core.js" type="text/javascript"></script> > <script src="/mapstraction/source/mxn.google.js" type="text/javascript"></script> > > I think it''s preferable to auto-load, as you have, but this could help determine where the error lies.Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos
Adam DuVander
2010-Feb-19 06:10 UTC
[Mapstraction] ReferenceError: Can''t find variable: mxn
I''m hoping Rob Moran will weigh in about this. --- Adam DuVander I like maps: http://mapscripting.com I like simple: http://adamduvander.com On Feb 18, 2010, at 9:04 PM, Lev Tsypin wrote:> That''s actually what I did and it seems to have fixed the problem, thanks Adam. Does that mean no auto-load, or there is a fix that can be made? I haven''t heard about this issue before. > > On Feb 18, 2010, at 6:26 PM, Adam DuVander wrote: > >> I''m wondering if this is related to some of the auto-loading issues in Webkit? >> >> If you load core and individual provider libraries explicitly, that will likely solve the issue. In other words: >> <script src="http://maps.google.com/maps?file=api&v=2&key=***" type="text/javascript"></script> >> <script src="/mapstraction/source/mxn.core.js" type="text/javascript"></script> >> <script src="/mapstraction/source/mxn.google.js" type="text/javascript"></script> >> >> I think it''s preferable to auto-load, as you have, but this could help determine where the error lies. > > Lev Tsypin > _____________________ > Level Online Strategy, LLC > 503.342.8044 > levelos.com | twitter.com/levelos >
Hmm, I think the problem may be a race issue (akin to the webkit problem). A quick look at the source leads me to believe that the inclusion of the mxn.core.js is happening AND executing before the mxn variable has been declared in mxn.js. I think a fix would be to move the writing out of autoload scripts after the mxn declaration in mxn.js. I can''t confirm this at the moment, may find some time tomorrow :) Perhaps a more reliable way of doing the autoload is required which blocks execution until all scripts are embedded and executed. Cheers, Rob On 19 February 2010 06:10, Adam DuVander <mapstraction at duvander.com> wrote:> I''m hoping Rob Moran will weigh in about this. > --- > Adam DuVander > I like maps: http://mapscripting.com > I like simple: http://adamduvander.com > > On Feb 18, 2010, at 9:04 PM, Lev Tsypin wrote: > > > That''s actually what I did and it seems to have fixed the problem, thanks > Adam. Does that mean no auto-load, or there is a fix that can be made? I > haven''t heard about this issue before. > > > > On Feb 18, 2010, at 6:26 PM, Adam DuVander wrote: > > > >> I''m wondering if this is related to some of the auto-loading issues in > Webkit? > >> > >> If you load core and individual provider libraries explicitly, that will > likely solve the issue. In other words: > >> <script src="http://maps.google.com/maps?file=api&v=2&key=***" > type="text/javascript"></script> > >> <script src="/mapstraction/source/mxn.core.js" > type="text/javascript"></script> > >> <script src="/mapstraction/source/mxn.google.js" > type="text/javascript"></script> > >> > >> I think it''s preferable to auto-load, as you have, but this could help > determine where the error lies. > > > > Lev Tsypin > > _____________________ > > Level Online Strategy, LLC > > 503.342.8044 > > levelos.com | twitter.com/levelos > > > > _______________________________________________ > 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/20100219/858c2c82/attachment.htm>
Derek Fowler
2010-Feb-19 12:59 UTC
[Mapstraction] ReferenceError: Can''t find variable: mxn
The auto-load code did used to be at the bottom of mxn.js however was moved to the top to fix the WebKit issue if I remember rightly. It''s possible that WebKit''s resource loading has since been changed so this would now work however we need a more robust solution. I think I was investigating writing script tags out rather than creating script elements as this is how the other mapping providers perform this operation in a cross-browser fashion. Derek On 19 February 2010 08:37, Rob <mapstraction at thegecko.org> wrote:> Hmm, I think the problem may be a race issue (akin to the webkit problem). > > A quick look at the source leads me to believe that the inclusion of the > mxn.core.js is happening AND executing before the mxn variable has been > declared in mxn.js. > > I think a fix would be to move the writing out of autoload scripts after > the mxn declaration in mxn.js. > > I can''t confirm this at the moment, may find some time tomorrow :) > > Perhaps a more reliable way of doing the autoload is required which blocks > execution until all scripts are embedded and executed. > > Cheers, > > Rob > > On 19 February 2010 06:10, Adam DuVander <mapstraction at duvander.com>wrote: > >> I''m hoping Rob Moran will weigh in about this. >> --- >> Adam DuVander >> I like maps: http://mapscripting.com >> I like simple: http://adamduvander.com >> >> On Feb 18, 2010, at 9:04 PM, Lev Tsypin wrote: >> >> > That''s actually what I did and it seems to have fixed the problem, >> thanks Adam. Does that mean no auto-load, or there is a fix that can be >> made? I haven''t heard about this issue before. >> > >> > On Feb 18, 2010, at 6:26 PM, Adam DuVander wrote: >> > >> >> I''m wondering if this is related to some of the auto-loading issues in >> Webkit? >> >> >> >> If you load core and individual provider libraries explicitly, that >> will likely solve the issue. In other words: >> >> <script src="http://maps.google.com/maps?file=api&v=2&key=***" >> type="text/javascript"></script> >> >> <script src="/mapstraction/source/mxn.core.js" >> type="text/javascript"></script> >> >> <script src="/mapstraction/source/mxn.google.js" >> type="text/javascript"></script> >> >> >> >> I think it''s preferable to auto-load, as you have, but this could help >> determine where the error lies. >> > >> > Lev Tsypin >> > _____________________ >> > Level Online Strategy, LLC >> > 503.342.8044 >> > levelos.com | twitter.com/levelos >> > >> >> _______________________________________________ >> 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 > >-- 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/20100219/2a62ab26/attachment-0001.htm>
Thats right, it was moved to fix that issue. The current solution writes script tags (the more commonly used method) rather than creating dom elements. Rob On 19 February 2010 12:59, Derek Fowler <dezfowler at gmail.com> wrote:> The auto-load code did used to be at the bottom of mxn.js however was moved > to the top to fix the WebKit issue if I remember rightly. It''s possible that > WebKit''s resource loading has since been changed so this would now work > however we need a more robust solution. I think I was investigating writing > script tags out rather than creating script elements as this is how the > other mapping providers perform this operation in a cross-browser fashion. > > Derek > > > On 19 February 2010 08:37, Rob <mapstraction at thegecko.org> wrote: > >> Hmm, I think the problem may be a race issue (akin to the webkit problem). >> >> A quick look at the source leads me to believe that the inclusion of the >> mxn.core.js is happening AND executing before the mxn variable has been >> declared in mxn.js. >> >> I think a fix would be to move the writing out of autoload scripts after >> the mxn declaration in mxn.js. >> >> I can''t confirm this at the moment, may find some time tomorrow :) >> >> Perhaps a more reliable way of doing the autoload is required which blocks >> execution until all scripts are embedded and executed. >> >> Cheers, >> >> Rob >> >> On 19 February 2010 06:10, Adam DuVander <mapstraction at duvander.com>wrote: >> >>> I''m hoping Rob Moran will weigh in about this. >>> --- >>> Adam DuVander >>> I like maps: http://mapscripting.com >>> I like simple: http://adamduvander.com >>> >>> On Feb 18, 2010, at 9:04 PM, Lev Tsypin wrote: >>> >>> > That''s actually what I did and it seems to have fixed the problem, >>> thanks Adam. Does that mean no auto-load, or there is a fix that can be >>> made? I haven''t heard about this issue before. >>> > >>> > On Feb 18, 2010, at 6:26 PM, Adam DuVander wrote: >>> > >>> >> I''m wondering if this is related to some of the auto-loading issues in >>> Webkit? >>> >> >>> >> If you load core and individual provider libraries explicitly, that >>> will likely solve the issue. In other words: >>> >> <script src="http://maps.google.com/maps?file=api&v=2&key=***" >>> type="text/javascript"></script> >>> >> <script src="/mapstraction/source/mxn.core.js" >>> type="text/javascript"></script> >>> >> <script src="/mapstraction/source/mxn.google.js" >>> type="text/javascript"></script> >>> >> >>> >> I think it''s preferable to auto-load, as you have, but this could help >>> determine where the error lies. >>> > >>> > Lev Tsypin >>> > _____________________ >>> > Level Online Strategy, LLC >>> > 503.342.8044 >>> > levelos.com | twitter.com/levelos >>> > >>> >>> _______________________________________________ >>> 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 >> >> > > > -- > 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/20100219/62eaa691/attachment.htm>
Derek Fowler
2010-Feb-19 13:32 UTC
[Mapstraction] ReferenceError: Can''t find variable: mxn
Ah, that will teach me for not checking the source. Will have to look for another solution then. Derek On Feb 19, 2010 1:19 PM, "Rob" <mapstraction at thegecko.org> wrote: Thats right, it was moved to fix that issue. The current solution writes script tags (the more commonly used method) rather than creating dom elements. Rob On 19 February 2010 12:59, Derek Fowler <dezfowler at gmail.com> wrote: > > The auto-load code did us... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100219/19145371/attachment.htm>
My apologies ahead of time as I''m new to this group and codebase and am no JS ninja, but here are my initial thoughts. Seems this declaration, "var $m = mxn.util.$m;" should happen in a callback that is fired after all the required scripts are loaded. As it is now, it stands alone at the top of the mxn.core.js, where there is no way of knowing if mxn.js has finished loading. Can''t it be declared in mxn.js once all the required scripts are loaded instead? On Feb 19, 2010, at 5:32 AM, Derek Fowler wrote:> Ah, that will teach me for not checking the source. Will have to look for another solution then. > >Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100219/8c9129bb/attachment.htm>
You could try moving it to the bottom of the mxn.js script to test your theory? On 19 February 2010 18:38, Lev Tsypin <lev at levelos.com> wrote:> My apologies ahead of time as I''m new to this group and codebase and am no > JS ninja, but here are my initial thoughts. > > Seems this declaration, "var $m = mxn.util.$m;" should happen in a callback > that is fired after all the required scripts are loaded. As it is now, it > stands alone at the top of the mxn.core.js, where there is no way of knowing > if mxn.js has finished loading. Can''t it be declared in mxn.js once all the > required scripts are loaded instead? > > On Feb 19, 2010, at 5:32 AM, Derek Fowler wrote: > > Ah, that will teach me for not checking the source. Will have to look for > another solution then. > > > Lev Tsypin > _____________________ > Level Online Strategy, LLC > 503.342.8044 > levelos.com | twitter.com/levelos > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100219/1ee0e539/attachment-0001.htm>
Any joy with my suggestion? Looking at the code, I thing the mxn.js script is getting a bit weighty. What do people think about puling the utilities out into a seperate script? Rob On 19 February 2010 19:18, Rob <mapstraction at thegecko.org> wrote:> You could try moving it to the bottom of the mxn.js script to test your > theory? > > > On 19 February 2010 18:38, Lev Tsypin <lev at levelos.com> wrote: > >> My apologies ahead of time as I''m new to this group and codebase and am no >> JS ninja, but here are my initial thoughts. >> >> Seems this declaration, "var $m = mxn.util.$m;" should happen in a >> callback that is fired after all the required scripts are loaded. As it is >> now, it stands alone at the top of the mxn.core.js, where there is no way of >> knowing if mxn.js has finished loading. Can''t it be declared in mxn.js once >> all the required scripts are loaded instead? >> >> On Feb 19, 2010, at 5:32 AM, Derek Fowler wrote: >> >> Ah, that will teach me for not checking the source. Will have to look for >> another solution then. >> >> >> Lev Tsypin >> _____________________ >> Level Online Strategy, LLC >> 503.342.8044 >> levelos.com | twitter.com/levelos >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100220/1334a822/attachment.htm>
Derek Fowler
2010-Feb-21 18:06 UTC
[Mapstraction] ReferenceError: Can''t find variable: mxn
The var $m line just aliases the function for use in core - it can''t be moved. There shouldn''t be issues with this as long as the files are being included in the correct order. If this is the case and there''s still an issue then we''ll have to investigate that. As for utils a lot of the functions in there were a copy and paste from v1 and it''s possible some of them aren''t even used within the library itself anymore. There may be opportunities to refactor elsewhere too. Also, I spent some time adding comments to the code for the auto generated docs which would appear to add bulk to the source files but are removed from the minified versions. Derek On Feb 20, 2010 5:47 PM, "Rob" <mapstraction at thegecko.org> wrote: Any joy with my suggestion? Looking at the code, I thing the mxn.js script is getting a bit weighty. What do people think about puling the utilities out into a seperate script? Rob On 19 February 2010 19:18, Rob <mapstraction at thegecko.org> wrote: > > You could try moving it to t... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100221/2ce1dc1c/attachment.htm>
Sorry for the lack of response on this one, been a bit buried. I wrote a Drupal Mapstraction module (http://drupal.org/project/mapstraction), and wanted to note that some users of the module are having similar issues (http://drupal.org/node/782752). I think I mostly got around it by explicitly loading all required JS files rather than using the loader, but it still seems to happen on occasion. Must be a race condition with the scripts? Someone added a comment to the issue about commenting out some of the code in the mxn.js, http://code.google.com/p/mapstraction/issues/detail?id=34. What''s the story with that? Lev Tsypin _____________________ Level Online Strategy, LLC 503.342.8044 levelos.com | twitter.com/levelos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100427/bfb4441e/attachment.htm>
Apologies if this isn''t the correct place to ask this: I would like to change a markers icon to a highlighted state when the correct entry on a corresponding list is moused over. At the moment I''m trying to use marker.setIcon() to change the markers icon URL. However it appears that although this changes the marker.iconUrl attribute the icon itself is actually using marker.proprietary_marker.$.icon.image to display the markers image - so the markers icon remains unchanged. Is there a way to dynamically change the marker.proprietary_marker.$.icon.image? Regards, Paul Owens HotelConnect Ltd is a company registered in England and Wales with company number 2875544.VAT registration GB671842911. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100428/7407ab08/attachment.htm>
Hi Paul, I''ve worked round this limitation in the past by using the proprietary marker as you suggest. Once you have the proprietary marker, you will need to use the methods available for a marker in your chosen mapping system to change the icon. For example, in google maps, the following should work: marker.proprietary_marker.setImage("url_to_your_image"); Cheers, Rob On 28 April 2010 11:57, Paul Owens <POwens at hotelconnect.co.uk> wrote:> Apologies if this isn?t the correct place to ask this: > > > > I would like to change a markers icon to a highlighted state when the > correct entry on a corresponding list is moused over. At the moment I?m > trying to use marker.setIcon() to change the markers icon URL. However it > appears that although this changes the marker.iconUrl attribute the icon > itself is actually using marker.proprietary_marker.$.icon.image to display > the markers image - so the markers icon remains unchanged. Is there a way > to dynamically change the marker.proprietary_marker.$.icon.image? > > > > Regards, > > Paul Owens > > > > > > > > HotelConnect Ltd is a company registered in England and Wales with company number 2875544.VAT registration GB671842911. > > > > > _______________________________________________ > 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/20100428/a226febf/attachment.htm>
have had exact same use case and exact same problem. only way I found to solve it was to use the proprietary marker I''m sad to say 2010/4/28 Paul Owens <POwens at hotelconnect.co.uk>> Apologies if this isn?t the correct place to ask this: > > > > I would like to change a markers icon to a highlighted state when the > correct entry on a corresponding list is moused over. At the moment I?m > trying to use marker.setIcon() to change the markers icon URL. However it > appears that although this changes the marker.iconUrl attribute the icon > itself is actually using marker.proprietary_marker.$.icon.image to display > the markers image - so the markers icon remains unchanged. Is there a way > to dynamically change the marker.proprietary_marker.$.icon.image? > > > > Regards, > > Paul Owens > > > > > > > > HotelConnect Ltd is a company registered in England and Wales with company number 2875544.VAT registration GB671842911. > > > > > _______________________________________________ > 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/20100428/5df4ce86/attachment.htm>
The call to setIcon() will only be picked up if you remove and then re-add the marker. This may well be quick enough for you to not notice the marker disappear so may be worth giving it a try before messing with the proprietary marker. Derek On 28 April 2010 14:41, Ed Freyfogle <edf at sloan.mit.edu> wrote:> have had exact same use case and exact same problem. > > only way I found to solve it was to use the proprietary marker I''m sad to > say > > > 2010/4/28 Paul Owens <POwens at hotelconnect.co.uk> > >> Apologies if this isn?t the correct place to ask this: >> >> >> >> I would like to change a markers icon to a highlighted state when the >> correct entry on a corresponding list is moused over. At the moment I?m >> trying to use marker.setIcon() to change the markers icon URL. However it >> appears that although this changes the marker.iconUrl attribute the icon >> itself is actually using marker.proprietary_marker.$.icon.image to >> display the markers image - so the markers icon remains unchanged. Is there >> a way to dynamically change the marker.proprietary_marker.$.icon.image? >> >> >> >> Regards, >> >> Paul Owens >> >> >> >> >> >> >> >> HotelConnect Ltd is a company registered in England and Wales with company number 2875544.VAT registration GB671842911. >> >> >> >> >> _______________________________________________ >> 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 > >-- 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/20100503/a6710eb9/attachment.htm>