Lotus Posted February 10, 2009 Report Share Posted February 10, 2009 probably a simple question, AND has nothing to do with an issue! What do I need to add/change to control the zoom level on the live map? I checked the Google API site, and must have been looking in the wrong area since the code was somewhat different from what is in the program. Thanks! Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 10, 2009 Administrators Report Share Posted February 10, 2009 In route_map.tpl, I think it's called "zoom level" Quote Link to comment Share on other sites More sharing options...
Lotus Posted February 10, 2009 Author Report Share Posted February 10, 2009 Been through route_map.tpl. No reference to zoom level there. BTW, the online documentation shows it being displayed like this... "map.setCenter(new GLatLng(37.4419, -122.1419), 13);" Changing that 13 changes the zoom. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 10, 2009 Administrators Report Share Posted February 10, 2009 Yeah the 13 is the zoom level. Been a while since I've looked at that code The live map... /lib/js/acarsmap.js, line 28. That'll get overwritten in an update but I can add a setting for it In route map, it's automatically adjusted, to fit the entire route Quote Link to comment Share on other sites More sharing options...
Lotus Posted February 10, 2009 Author Report Share Posted February 10, 2009 I appreciate that. I don't know how many people would need that functionality, but my airline is serving a fairly small area. Zoom out too far, and you'll miss the whole area. Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 29, 2009 Report Share Posted May 29, 2009 Hey All I definately need that fuctionality, but it does not matter what zoom level I select its stays the same. I copied teh appropriate js file to my skin nothing works. I even editied the original js file and that also does not work. Does everyone else have teh same issue as well? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 29, 2009 Administrators Report Share Posted May 29, 2009 That's an odd bug. The JS file you edit in place, only templates you move to your skin folder. What exactly are you trying to do? Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 29, 2009 Report Share Posted May 29, 2009 Hi Nabeel Yeah the JS file I left in place, it did not seem right to move it over (even though I did try that too Here is what I want to do http://www.orrencharters.co.za/index.php/acars This will show central and south africa, not bad looking, but my VA runs only in one of the provinces. Now I dont need such a zoom, all I want is that map window to fill up with South Africa. When I tested this with a friend of mine, using normal google API I get it right, wel he did I didn't ;D I was wondering if teh doctype would make any difference, I see that page is transitional, maybe it shoud be strict? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 29, 2009 Administrators Report Share Posted May 29, 2009 I don't know about that, I'd check the Google's docs. I'm pretty sure it's transitional by default. The zoom levels are funky, but I think I had moved the zoom setting to the local config. Unless of course, I didn't... lol Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 29, 2009 Report Share Posted May 29, 2009 ha ha ha I hear you. I checked teh local.config file and there is no refernce to teh zoom level. I put one in calling it MAP_ZOOM_LEVEL, but no I could not get it to work. Its definatloy there in teh js file but it just does nothing when I change that oom level. very wierd. Its no train smash at all, At least it shows South Africa. That's a whole lot better than what teh default fsacars world map was ;D Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 What values did you try for the level? The numbers work backwards almost, like a 19 is really zoomed out. Adding a config value directly won't do anything since it's not parsed by JS. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 I had a time with this as well. What I found was that the "13" is overridden by the code following it; var bds = new GLatLngBounds(new GLatLng(20.8258173, 3.74226154), new GLatLng(23.2391067, 6.92817646)); The map can be zoomed by changing the red sectons. It takes some work with a map and a calculator to find the correct lat/long figures for the location you want to view. I found the google information helpful as well here - http://code.google.com/apis/maps/documentation/reference.html#GLatLngBounds.GLatLngBounds you can view the map I got to work here - http://www.simpilotgroup.com/newenglandair Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 Good catch... What that'll do is zoom it in just enough to cover both the arrival and departure airports. You can remove that line and use only the center, and then manually center it where you want (I think there's a config option). Which file are you looking at? The acarsmap.js? Or is it the routemap.tpl? Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 30, 2009 Report Share Posted May 30, 2009 Hey Simpilot Yes thats exaclty the thing I need, thanks bery much. I thought it was wierd thaht it keeps getting overridden. Ill check it out and post if successfull or not! Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 30, 2009 Report Share Posted May 30, 2009 Honestly, this stuff just goes way over my head. I thought I would be able to understand it but these old brain cells are packing up ??? ;D I have no idea what I am supposed to do, really. but I put those coordinates in exactly teh way you typed them and it works, then I change the 23 to a 25 and now I have exactly what I am looking for Thanks very much, I am over teh moon with teh map!!! Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 ^ Haha! Which file are you guys working in? Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 30, 2009 Report Share Posted May 30, 2009 Hey Nabeel I am working in the acarsmap.js file I hope thats right, anyway when I tested it locally it was perfect, I upload to the main server and its on the east coast of America ;D ;D Back to teh drawing board for me Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 Ok great, just keep in mind to change that in future updates! I'm gonna look through it and see what I can do to remedy that Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 30, 2009 Report Share Posted May 30, 2009 Excellent Nabeel, yeah I forgot about future updates. Sadly my test failed and I now have an even further zoomed out map What I have noticed however, that if you position teh map and zoom the way you like it, and you move your mouse ove the google logo in teh bottom left hand corner, then it will show teh lat and long for that view. I tried entering those coordinates, but nope did not work for me. Would it be possible to rather make teh JS files link back to the skins? like teh template files. I ask this as I have modded a few JS files i.e Booking instead of bidding etc. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 The JS file changes at times. What I do is create a setting in the log file, then set that in the core_htmlhead.tpl, so it's available. What other mods did you make? Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 30, 2009 Report Share Posted May 30, 2009 At this point I have reset all mods, even the acars.js The only one I have left in terms of teh js files is I have changged added to booked in phpvms.js line 32 I defaulted back to teh normal acars.js is I was getting some wierd result between IE and FF, each one showing me a different section of our world (sam config) ;D ;D So based on that small change Nabeel its really ok. I though I had done more, it was more of the same change to the same file, acars.js. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted May 30, 2009 Administrators Report Share Posted May 30, 2009 I had no issues (that I know of) with cross browsers. With the map giving weird results, you have to place your map "center" location n the local.config file. Then to actually zoom you need to change the parameters in the acars.js file as shown prior, catch is... those numbers have to fit both the map window you are using as well as the map from google, hence the long extensions behind the decimal. These have to be calculated for your map if it is sized differently than the default VMS map. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 31, 2009 Administrators Report Share Posted May 31, 2009 Sometimes CSS interferes with the google map. Any general styles for img {} or something. Quote Link to comment Share on other sites More sharing options...
selwynorren Posted May 31, 2009 Report Share Posted May 31, 2009 Hi Nabeel No thing that I can thing off, I basically used teh crystal skin, deleted everything I was not using and added a few to customise. But I everntually was hackling away so much with my various prjects that I just screwed it all up. I have now deleted everything, and will try and start from scratch again. I am just irritated that I cannot get this code issue right. I even tried out the bids on teh front page and I get a zero. Anyway maybe over teh next few weeks I can hash something kinda respectable Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 1, 2009 Administrators Report Share Posted June 1, 2009 It's ok!! Go slow, and read some PHP tutorials too. It's a little tough to jump straight into it, but as usual, any questions, go ahead and ask Quote Link to comment Share on other sites More sharing options...
selwynorren Posted June 1, 2009 Report Share Posted June 1, 2009 Thanks Nabeel, I was introduced to php for teh first time of this year, kind bbeen forced into it, and its a steep learning curve for me, I am working through w3schools courses at teh moment, as well as a few others. I understand teh basics of teh code and can write a few apps as well, on my train sim website I created teh entire news system there in php. really simple stuff. But teh object programming you have used here is ingeneous, and I have never encountered that before except for phpBB, uses the same kind of templating system. Maybe one day when I grow up I could do this he he he. I am still a little lost concerning this map control however. I dont undertsand how to do teh calculations, Simpilot would you mind showing me how you did it, kina like a setp up phpvms with google maps for dummies kinda thing lol. Guys have a super day, I am sure Ill catch you all online later on. Nabeel, again, thanks fo your patience and undertsanding!! Your a great teacher!! Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 2, 2009 Administrators Report Share Posted June 2, 2009 No prob, check out sitepoint.com too, great tutorials there Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.