I am trying to switch over to v2.1 Had problems specifying the mapstraction import as a remote url, so i downloaded the source. I can get the examples to work, but not my app. Get a ''ReferenceError'' when i try to do... var mapstraction = new mxn.Mapstraction(''mapDiv'', ''googlev3''); anybody got advice? Angus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20130307/5928c817/attachment.htm>
Can you post a (small) compete working sample that demonstrates this? Can''t see anything immediately wrong but without seeing the bigger picture its difficult to tell. -Gary Sent from my iPhone On 7 Mar 2013, at 19:28, Angus Henderson <ahenderson at immersivemedia.com> wrote:> I am trying to switch over to v2.1 > > Had problems specifying the mapstraction import as a remote url, so i downloaded the source. > > I can get the examples to work, but not my app. > > Get a ''ReferenceError'' when i try to do... > > var mapstraction = new mxn.Mapstraction(''mapDiv'', ''googlev3''); > > anybody got advice? > > Angus > > > > > _______________________________________________ > 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/20130307/55cf3d19/attachment.htm>
Just tested this with the current v2.1 release ... take a look at http://maps.geotastic.org/mxn/googlev3.html, it''s a self contained version of the MXN Google v3 example, using the latest v2.1 build from GitHub and hosted on GitHub. It''s working for me. Do a view source on the page to see details. -Gary -- gary at vicchi.org | twitter.com/vicchi | www.linkedin.com/in/garygale | www.garygale.com On 7 Mar 2013, at 20:18, Gary Gale wrote:> Can you post a (small) compete working sample that demonstrates this? > > Can''t see anything immediately wrong but without seeing the bigger picture its difficult to tell. > > -Gary > > Sent from my iPhone > > On 7 Mar 2013, at 19:28, Angus Henderson <ahenderson at immersivemedia.com> wrote: > >> I am trying to switch over to v2.1 >> >> Had problems specifying the mapstraction import as a remote url, so i downloaded the source. >> >> I can get the examples to work, but not my app. >> >> Get a ''ReferenceError'' when i try to do... >> >> var mapstraction = new mxn.Mapstraction(''mapDiv'', ''googlev3''); >> >> anybody got advice? >> >> Angus >> >> >> >> >> _______________________________________________ >> 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/20130308/d6c1914f/attachment.htm>
I am up and running now thanks. This is a major improvement, I like the added addTileLayer support. The problem with the map not showing up ''just went away'' as i was preparing a cut down example. I did have some issues with getBounds(), which i was calling soon after the map was created. In v2.1 I got NaN''s at first then real values once the map had initialized. same with getZoom(). Maybe theres a ''onMapInitiaized'' event i can use - what does mxn.* deferUntilLoaded*(fnCall) do? Angus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20130308/e1acc1b7/attachment.htm>
You''ll need to hook into the Mapstraction load event which does just what you need (I think). If you look at that Google v3 example, you''ll see this at line 65 ... map.load.addHandler(function(en, es, ea) { logEvent (''Map loaded''); }); ... you can use this event handler and customise it for you needs. The deferUntilLoaded function is a private one, internal to the mysterious way of Mapstraction; probably not a good idea to use that. G -- gary at vicchi.org | twitter.com/vicchi | www.linkedin.com/in/garygale | www.garygale.com On 8 Mar 2013, at 19:31, Angus Henderson wrote:> I am up and running now thanks. This is a major improvement, I like the added addTileLayer support. > > The problem with the map not showing up ''just went away'' as i was preparing a cut down example. > > I did have some issues with getBounds(), which i was calling soon after the map was created. In v2.1 I got NaN''s at first then real values once the map had initialized. same with getZoom(). > Maybe theres a ''onMapInitiaized'' event i can use - what does mxn.deferUntilLoaded(fnCall) do? > > Angus > _______________________________________________ > 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/20130308/359629a3/attachment.htm>
My mapstraction application is working well in chrome & firefox, but in IE, the map is offset below and to the right of it''s <div> // Add an inner <div> the the main one document.getElementById( ''mapDiv'' ).innerHTML = "<div id=''innerMapDiv'' style=''width: 100%; height: 100%'' </div>"; // create the Map mapstraction = new mxn.Mapstraction( ''innerMapDiv'', provider ); ..... <!-- map display div --> <div id="mapDiv" style="z-index:1; margin:0 auto; position:absolute; left:740px; top:36px; width:640px; height:360px; visibility:hidden"></div> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20130328/fd5bf390/attachment.htm>