P
P
Pashchuk Ilya2016-01-27 12:32:11
css
Pashchuk Ilya, 2016-01-27 12:32:11

Navigation does not work on the connected Google Maps map, what should I do?

Hi friends! I connected a stylized Google Maps map to the site in a modal window and moving around the map does not work, just the map is inserted into the block and that's all, what to do?
Thanks in advance for advice!

var map;
var mapCoordinates = new google.maps.LatLng(52.973276, 80.2296082);


function initialize()
{
var mapOptions = {
backgroundColor: "#ffffff", // цвет фона
zoom: 8, // масштаб
disableDefaultUI: true,
draggable: false,
scrollwheel: false,
center: mapCoordinates,
mapTypeId: google.maps.MapTypeId.ROADMAP,
//----------- стили ----------
styles:[
    {
        "featureType": "administrative",
        "elementType": "labels.text.fill",
        "stylers": [
            {
                "color": "#444444"
            }
        ]
    },
    {
        "featureType": "landscape",
        "elementType": "all",
        "stylers": [
            {
                "color": "#f2f2f2"
            }
        ]
    },
    {
        "featureType": "poi",
        "elementType": "all",
        "stylers": [
            {
                "visibility": "off"
            }
        ]
    },
    {
        "featureType": "road",
        "elementType": "all",
        "stylers": [
            {
                "saturation": -100
            },
            {
                "lightness": 45
            }
        ]
    },
    {
        "featureType": "road.highway",
        "elementType": "all",
        "stylers": [
            {
                "visibility": "simplified"
            }
        ]
    },
    {
        "featureType": "road.arterial",
        "elementType": "labels.icon",
        "stylers": [
            {
                "visibility": "off"
            }
        ]
    },
    {
        "featureType": "transit",
        "elementType": "all",
        "stylers": [
            {
                "visibility": "off"
            }
        ]
    },
    {
        "featureType": "water",
        "elementType": "all",
        "stylers": [
            {
                "color": "#8a589b"
            },
            {
                "visibility": "on"
            }
        ]
    }
]
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);


//Функция для «прыжка» маркера:

this.toggleBounceMarker = function()
{
    if (_this.setMarker.getAnimation() != null) {
        _this.setMarker.setAnimation(null);
    } else {
        _this.setMarker.setAnimation(google.maps.Animation.BOUNCE);
    }   
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Voronkov, 2016-01-27
@IlyaDeveloper

Try setting draggable: true

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question