Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1174936
Error on Map - Business Construction Page
Closed

Comments

  • Natan Cavalcanti started the conversation

    Hi there!

    I need a little help here.

    I have purchased and deployed Civil Construction Page using TheGem theme.

    So far I had no issues. I have implemented on www.natsolutions.com.br/sabatim as a development environment. Now, I have finished everything and I moved it to www.sabatim.com.br production environment. Everything went fine, except the black Google MAP near the footer.

    It tries to load, I can see it appearing, but right after that it displays the following error:

    Oops! Something went wrong.
    This page didn't load Google Maps correctly. See the JavaScript console for technical details.

    I tried to install Google API Key, but it did not work.

    Any ideas how can I solve it please ?

    Thank you,

    Natan

  • Natan Cavalcanti replied

    Hi,

    I have missed sharing the HTML source, sot his is my current HTML Code for this MAP:

    <div id="map-canvas" style="width: 100%; height: 500px;"></div>
    <script type='text/javascript' src='//maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&ver=4.2.8'></script>
    <script type="text/javascript"> function initialize() {

        var mapOptions = {
            zoom: 14,
            center: {lat: -23.5027133, lng: -46.6345128},
            mapTypeControlOptions: {
            mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style']},  
            disableDefaultUI: true,
            disableDoubleClickZoom: true,
            scrollwheel: false, // change
            draggable: true // change
        };

        var styles =[{"featureType":"all","elementType":"labels.text","stylers":[{"visibility":"on"}]},{"featureType":"all","elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":"70"}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"off"},{"color":"#000000"},{"lightness":"30"}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"on"},{"gamma":"0"},{"lightness":"-50"},{"saturation":"-90"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":"10"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21},{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":"40"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":"16"},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":"20"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#171717"},{"lightness":17}]}];

        var styledMap = new google.maps.StyledMapType(styles,
        {name: "Styled Map"});

        var map = new google.maps.Map(document.getElementById('map-canvas'),
            mapOptions);

        map.mapTypes.set('map_style', styledMap);
        map.setMapTypeId('map_style');
    }
        
    google.maps.event.addDomListener(window, 'load', initialize); </script>

    Thanks,

    Natan

  •  7,122
    Oliver replied

    HI!

    pls. provide the wp-admin access.

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •   Natan Cavalcanti replied privately
  •  7,122
    Oliver replied

    Seems the problem in apy key, pls. add your apy key to the map:

    https://developers.google.com/maps/documentation/javascript/get-api-key

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Natan Cavalcanti replied

    Hi Gregor,

    It worked fine! Now I get it. The isse was I should implement my key direcly in the HTML source.

    Thank you very much for your support.

    Best regards,

    Natan

  •  7,122
    Oliver replied

    Feel free to contact us if you need help.

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver