Rigodon Posted September 3, 2015 Share Posted September 3, 2015 Hello,For some reason I map the script does not charge, my source page:The script map: <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAj_ODBkgxB4OHLp0Fsa-VcRQf68fUWII4n159N-cgzaYV2ilj2BTE5ip8WZMGe9OUHJsu_G068IPl8w" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); var MapTypes = map.getMapTypes(); MapTypes[0].getName = function () { return "Mapa"; } MapTypes[1].getName = function () { return "Satelitarna"; } MapTypes[2].getName = function () { return "Hybrydowa"; } map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(54.352279593080354, 18.687057495117188), 14); var marker = new GMarker(new GLatLng(54.3522028, 18.6880193)); map.addOverlay(marker); } } //]]> </script> <div id="map" style=" width: 950px; height: 400px; background: url(http://web4you.com.pl/template/loader.gif); background-repeat: no-repeat; background-position: center;"> </div> Quote Link to comment https://forums.phpfreaks.com/topic/298036-map-does-not-load/ Share on other sites More sharing options...
hansford Posted September 6, 2015 Share Posted September 6, 2015 It works fine. You just need to call the load() function like so: window.onload = load; Quote Link to comment https://forums.phpfreaks.com/topic/298036-map-does-not-load/#findComment-1520383 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.