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 #3514744
Google maps
Closed

Comments

  • Andy Coteman started the conversation

    I cannot get the google map to show in theme please.


    Does there need to be an API for this please?


    I coud not see anything in the documentation.


    THanks

  •  7,120

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

    Regards, Oliver

  • Andy Coteman replied

    In the demo I am using it just has this code and does not uise the WP bakery map functionality

    0?ui=2&ik=32608966de&attid=0.1&permmsgid=msg-a:r-6525105687387999188&th=18ba3f14a8580854&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ877ulkGsUwpG0A_PIOfBG1rCCwBTbtBo1hdc-0D1LdkKw67UmMB4lYNZLxC1YWkYNxKVRnH8rVuqi1X7ZbFwXNmGOx2iByiLG08vDzcGhzduNFHo5SwkVKr_I&disp=emb&realattid=ii_lomp2a010

    <div id="map-canvas" style="width: 100%; height: 500px;"></div>
    <script type='text/javascript' src='//maps.googleapis.com/maps/api/js?key=AIzaSyCruHDq70rCC4uPG_wkMxP6nS5SNoQEN4A'></script>
    <script type="text/javascript"> function initialize() {

    var mapOptions = {
    zoom: 11,
    center: {lat: 51.545190, lng: -0.480470},
    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>

    Attached files:  Untitled.png

  •  4,803
    Michael replied

    Hi,

    Yes, of course you need an API to create maps like this, in this case it's here:

    https://prnt.sc/FKkzfhZQ0J1g

     But you need to create a map using your own API.