Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle maps shows error info instead of map
    primarykey
    data
    text
    <p>I wanted to add a map with some custom markers on it to my project. On localhost everything works fine but when I've sent the code to the production server I got 'Sorry, we don't have map of this region in required scale' (or something similar). This is the code :</p> <pre><code>&lt;script type='text/javascript'&gt; var map; var mapStart = function(){ if(GBrowserIsCompatible()){ map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(51.961869,19.134521),6); map.addControl(new GLargeMapControl()); var ikona1 = new GIcon(); ikona1.image = "{{MEDIA_URL}}images/map_icon_1.png"; ikona1.iconSize = new GSize(36, 30); ikona1.infoWindowAnchor = new GPoint(16,16); ikona1.iconAnchor = new GPoint(16,16); var data_map = {{ properties|safe }} map.enableDoubleClickZoom(); map.enableContinuousZoom(); var bounds = new GLatLngBounds(); var maxlng =0; var maxlat=0; var minlng=0; var minlat=0; for (var i=0; i &lt; data_map.length; i++){ var pos_lat = parseFloat(data_map[i]['lat']); var pos_lon = parseFloat(data_map[i]['long']); addMarker(pos_lat, pos_lon,{icon:ikona1}, data_map[i]['info_box'] ); if (pos_lat &lt; minlat || minlat==0){ minlat = pos_lat} if (pos_lat &gt; maxlat || maxlat==0){ maxlat = pos_lat} if (pos_lon &lt; minlng || minlng==0){minlng = pos_lon} if (pos_lon &gt; maxlng || maxlng==0){maxlng = pos_lon} lat = minlat + (( maxlat - minlat)/2); lng = minlng + (( maxlng - minlng)/2); var allpoints = new GLatLng(lat,lng); bounds.extend(allpoints); } map.setZoom(map.getBoundsZoomLevel(bounds)-2); map.setCenter(bounds.getCenter()); } } var addMarker = function(lat, lon, options, info_box_html){ point = new GLatLng(lat,lon); var marker = new GMarker(point, options); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(info_box_html); }); map.addOverlay(marker); } $(document).ready(function(){ mapStart(); }); window.onunload = function (){ GUnload()}; &lt;/script&gt; </code></pre> <p>and I have the following import (with new key generated):</p> <p><code>&lt;script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAA2YOYLBVnylQ7NK445E1_gxQFK8hZs27CqIA3jAe_qRgIGP9GQBTFZjebH-xe-6vEjhK0Pa9agV_Mpg"&gt;&lt;/script&gt; </code></p> <p>data_map has proper form as I've already tested it locally. Also when I've commented out everything apart of creating map and adding control I got clear gray screen Anyone knows this error ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload