Jump to content

Map Control


Lotus

Recommended Posts

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!

Link to comment
Share on other sites

  • Administrators

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

Link to comment
Share on other sites

  • 3 months later...

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • Administrators

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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

Link to comment
Share on other sites

  • Administrators

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?

Link to comment
Share on other sites

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 :D

Thanks very much, I am over teh moon with teh map!!!

Link to comment
Share on other sites

Excellent Nabeel, yeah I forgot about future updates.

Sadly my test failed and I now have an even further zoomed out map  :D

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...