Trying to change the map zoom on the view screen but no matter what zoom level I choose it’s not changing
Any help please
Trying to change the map zoom on the view screen but no matter what zoom level I choose it’s not changing
Any help please
Is this a duplicate of your issue here
//forum.phpvms.net/applications/core/interface/index.html
Or related to a different module?
If so, what version of phpVMS are you on? Are you still on Google Maps or have you swapped it out for Leaflet or different?
If Google Maps, you should be able to change this value here:
https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/map.php#L7
Increasing it should zoom in, decreasing should zoom out.
If that doesn’t work, try going to the page and going into the console and running this (one line at a time):
var m = document.getElementById("routemap"); m.setZoom(12);
Hi
I know the zoom= but what ever value it is set to doesn’t change the zoom!
it seems I’m zoomed in maximum whatever that is! As I’m zoomed righ in to the runway of the airport. Other pages/modules, like acars map live display works fine.
using v5.5.2
thanks
1 hour ago, web541 said:
first line returns undefined
second line returns Uncaught TypeError: Cannot read property ‘setZoom’ of null at <anonymous>:1:3
Here is is a screenshot with console open with some error stuff! No idea as map zoom works on other pages no problems
[Capture.zip](< base_url >/applications/core/interface/file/attachment.php?id=4364)
6 hours ago, CFVA said:
first line returns undefined
That shouldn’t be happening, try this instead:
map.setZoom(12);
and check what the id=“” tag is on the map div, it should look like this
\<div id="routemap" style="width: 960px; height: 520px;"\>\</div\>
Are you sure it’s a zoom issue? So in that image, if you manually zoom out it shows imagery or still nothing no matter how far you zoom? The first two console messages could have something to do with it (linked google maps api .js more than once on the page, check your page source).
It could be it’s being overwritten somewhere else on the page or in another file.
4 hours ago, web541 said:
That shouldn’t be happening, try this instead:
map.setZoom(12);
That changed the zoom.
and check what the id=“” tag is
on the map div, it should look like this
<div id=“routemap” style=“width: 960px; height: 520px;”></div>
That line is exactly the same.
Are you sure it’s a zoom issue? So in that image, if you manually zoom out it shows imagery or still nothing no matter how far you zoom? The first two console messages could have something to do with it (linked google maps api .js more than once on the page, check your page source).
It could be it’s being overwritten somewhere else on the page or in another file.
Sure it’s a zoom issue. The imagery issue was just the location I was using.
Yes I can “manually” zoom in and out.
The module wasn’t made by me. I’ve no idea, it’s vFleetTracker Module Created By Vansers
These screenshots probably better
Can zoom in & out using scroll or +/- buttons, it’s just the zoom level it starts at. All other pages that use maps are fine, just this one
Quote
Thanks for the help so far
Oh I see I was looking at the wrong file for that page, it should’ve been the view.php.
Have you tried changing the zoom on this line?
https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L81
then try removing these lines temporarily and test
And if still nothing, try this in the console and PM me your url:
var m = document.getElementById("currentlocation"); m.setZoom(12);
3 hours ago, web541 said:
Oh I see I was looking at the wrong file for that page, it should’ve been the view.php.
Have you tried changing the zoom on this line?
https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L81
No change
3 hours ago, web541 said:
then try removing these lines temporarily and test
Just get a blank white square and no map!
3 hours ago, web541 said:
And if still nothing, try this in the console and PM me your url:
var m = document.getElementById(“currentlocation”); m.setZoom(12);
first line still undefined
second line Uncaught TypeError: m.setZoom is not a function at <anonymous>:1:3
thats with lines 94-102 IN or OUT !
http://cfva.freehostia.com/index.php/vFleetTracker/view/CF-005
Isn’t freehostia a free host? That could be your issue.
51 minutes ago, ProAvia said:
Isn’t freehostia a free host? That could be your issue.
It is, but maps in other pages all work. ACARS live map, the vFleetTracker map that shows where all aircraft are, just the 1 map when you view a single plane’s information. So it must be the code somewhere!
Thanks for the input though
So in your console, this will work to zoom in/out
map.setZoom(5);
At the end of the file here:
https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L203
Try putting this:
\<script\> map.setZoom(5); \</script\>
That should overwrite anything that’s there.
Also as a sidenote, to remove one of the google maps console messages, you will want to take your
\<script async defer src="https://maps.googleapis.com/maps/api/js?key=KEY"type="text/javascript"\>\</script\>
line (I think from your skin) and replace this in your core_htmlhead.php file (either in your skin or copy it from core/templates into your skins folder and edit it there)
\<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"\>\</script\>
11 hours ago, web541 said:
So in your console, this will work to zoom in/out
map.setZoom(5);
That’s works in the console mode
At the end of the file here:
https://github.com/KJRDev/phpVMS_vFleetTracker/blob/master/core/templates/vFleetTrack/view.php#L203
Try putting this:
<script> map.setZoom(5); </script>
That should overwrite anything that’s there.
Did that but no change
11 hours ago, web541 said:
Also as a sidenote, to remove one of the google maps console messages, you will want to take your
<script async defer src=“https://maps.googleapis.com/maps/api/js?key=KEY"type="text/javascript”></script>
line (I think from your skin) and replace this in your core_htmlhead.php file (either in your skin or copy it from core/templates into your skins folder and edit it there)
<script type=“text/javascript” src=“http://maps.google.com/maps/api/js?sensor=true”></script>
Did this but now get message This page can’t load Google Maps correctly. (I’ve reversed the changes now)
Open file core_htmlhead.php (core/templates folder)
search for
\<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"\>\</script\> \<script type="text/javascript" src="http://cfva.freehostia.com/lib/js/jquery.form.js"\>\</script\> \<script type="text/javascript" src="http://cfva.freehostia.com/lib/js/phpvms.js"\>\</script\> \<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDNz0LGNP3QqZJwR\_Kjm8C5ERKCXrEULsE"type="text/javascript"\>\</script\>
to
\<script type="text/javascript" src="http://cfva.freehostia.com/lib/js/jquery.form.js"\>\</script\> \<script type="text/javascript" src="http://cfva.freehostia.com/lib/js/phpvms.js"\>\</script\> \<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDNz0LGNP3QqZJwR\_Kjm8C5ERKCXrEULsE&callback=initMap" type="text/javascript"\>\</script\>
3 hours ago, gio1961 said:
Open file core_htmlhead.php (core/templates folder)
search for
<script type=“text/javascript” src=“http://maps.google.com/maps/api/js?sensor=true”></script> <script type=“text/javascript” src=“http://cfva.freehostia.com/lib/js/jquery.form.js”></script> <script type=“text/javascript” src=“http://cfva.freehostia.com/lib/js/phpvms.js”></script> <script async defer src=“https://maps.googleapis.com/maps/api/js?key=AIzaSyDNz0LGNP3QqZJwR\_Kjm8C5ERKCXrEULsE"type="text/javascript”></script>
to
<script type=“text/javascript” src=“http://cfva.freehostia.com/lib/js/jquery.form.js”></script> <script type=“text/javascript” src=“http://cfva.freehostia.com/lib/js/phpvms.js”></script> <script src=“https://maps.googleapis.com/maps/api/js?key=AIzaSyDNz0LGNP3QqZJwR\_Kjm8C5ERKCXrEULsE&callback=initMap” type=“text/javascript”></script>
There is a core_htmlhead.php in the skins folder as well as core/templates folder
Which one?
core/templates…
*****
I have seen now that inside the skin there is the same file. (core_htmlhead.php) Try as I said and rename the file that is inside the skin. (core_htmlhead_old.php)
15 minutes ago, gio1961 said:
core/templates…
Sorry to say that’s not made any difference. I may just take the map display off that page and not bother
2 minutes ago, CFVA said:
Sorry to say that’s not made any difference. I may just take the map display off that page and not bother
Did you make corrections? I do not think so… The codes are still there.
\<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"\>\</script\> \<script type="text/javascript" src="http://cfva.freehostia.com/lib/js/jquery.form.js"\>\</script\> \<script type="text/javascript" src="http://cfva.freehostia.com/lib/js/phpvms.js"\>\</script\> \<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDNz0LGNP3QqZJwR\_Kjm8C5ERKCXrEULsE"type="text/javascript"\>\</script\>
The live map does not work. http://cfva.freehostia.com/index.php/ACARS
33 minutes ago, gio1961 said:
The live map does not work. http://cfva.freehostia.com/index.php/ACARS
It does, seems not to load first time but a refresh sorts it.
2 minutes ago, CFVA said:
It does, seems not to load first time but a refresh sorts it.
Why don’t you try to make the change I told you? I see that there are still those codes …