Map Control

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!

In route_map.tpl, I think it’s called “zoom level”

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.

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

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.

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?

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?

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?

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

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

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.

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

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?

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!

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!!!

^ Haha!

Which file are you guys working in?

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

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

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.

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?