Hi, I have been experimenting with mapstraction/google v3 maps and like it quite a bit. However, now I''d like to style the map (change colors etc). For example, this page: http://www.41latitude.com/post/1268734799/google-styled-maps explains how to do it using the std api. I haven''t been able to find anything related to this functionality in mapstraction so far. Does anyone know if the functionality exists, or is planned? If not, would you have any pointers on where in the source I can hack it in? ;) -- -Mike ------------------------------------------------------------- Mike Miller Earth, Sol, Orion Arm, Milky Way, VSC
Hi Mike, great to see you interested in mxn, This functionality doesn''t exist. It''s tough because to my knowledge googlev3 and cloudmade are the only map providers who suppport styling, and cloudmade does it based off of the key you specify, you don''t actually need to call anything via the API. This might be a case where you would want to just access the underlying API keep in mind you can always access the underlying native map object and call provider specific methods, etc the other alternative is to add methods to mxn.googlev3.core.js and mxn.core.js good luck 2011/6/18 Mike Miller <mapstraction at mgmiller.net>:> Hi, > > I have been experimenting with mapstraction/google v3 maps and like it quite > a bit. ?However, now I''d like to style the map (change colors etc). ?For > example, this page: > http://www.41latitude.com/post/1268734799/google-styled-maps explains how to > do it using the std api. > > I haven''t been able to find anything related to this functionality in > mapstraction so far. ?Does anyone know if the functionality exists, or is > planned? ?If not, would you have any pointers on where in the source I can > hack it in? ?;) > > -- > -Mike > > > ?------------------------------------------------------------- > ?Mike Miller ? ? ? ? ? ? Earth, Sol, Orion Arm, Milky Way, VSC > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >
Thanks, I was able to figure it out and it works well. Next, I notice I can''t seem to use the geocoder without having a map visible. Is that correct? It isn''t important but was experimenting with bare bones scripts and couldn''t get it to work until I had a map div ready to go. -Mike ------------------------------ From: Ed Freyfogle <edf at sloan.mit.edu> To: mapstraction at lists.mapstraction.com Subject: Re: [Mapstraction] styled/themed map keep in mind you can always access the underlying native map object and call provider specific methods, etc
Hi Mike, Le 19/06/2011 09:39, Mike Miller a ?crit :> Thanks, I was able to figure it out and it works well. > > Next, I notice I can''t seem to use the geocoder without having a map > visible. Is that correct?Nope, it works great without a map diaplyed. Just look at the geocoder test file : https://github.com/mapstraction/mxn/blob/master/tests/geocoder.htm And i''ve just tested this code right now : <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Mapstraction Examples - Google v3</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script src="../source/mxn.js?(googlev3,[geocoder])" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ var geocoder; function geocode_return(geocoded_location) { console.log(geocoded_location); } function initialize() { geocoder = new mxn.Geocoder(''googlev3'',geocode_return); } function user_submit() { var address = {}; address.address = document.getElementById(''address'').value; geocoder.geocode(address); } //]]> </script> </head> <body onload="initialize();"> <center> <table border=''1'' width=''50%''> <tr> <td><div id="mapdiv"></div></td> </tr> <tr> <td> <input type="text" id="address" name="address" value="" size="35"/> <a href="#" onclick="user_submit(); return false;">Geocode</a> </td> </tr> </table> <a href=''#'' onclick=''changetohybrid();''>change to hybrid</a> <div id="position"></div> </center> </body> </html>
Hi, thanks for the reply. I think my original question was a bit inaccurate. I guess it can be hidden and not visible, but seems to not work unless the div is present. I believe I was trying to use it without much html at all. -Mike> ------------------------------ > From: bruno bergot<brunobergot at gmail.com> > Subject: Re: [Mapstraction] styled/themed map > Hi Mike, > Nope, it works great without a map diaplyed. Just look at the geocoder > test file : > > https://github.com/mapstraction/mxn/blob/master/tests/geocoder.htm > > And i''ve just tested this code right now :> <body onload="initialize();"> > <center> > <table border=''1'' width=''50%''> > <tr> > <td><div id="mapdiv"></div></td>