Skip to content

Bug on Route and setting map ID #63

@lboaretto

Description

@lboaretto

Hello,

If I use dynamic ID and Route, I get this error:

ReferenceError: map is not defined
    marker = new GoogleMaps.Marker(map, {(...)

Map with Route only accept ID 'map'

{% set mapID = 'map' ~ entry.id %}
{% set options = {
    id: mapID, 
    width: '940px', 
    height: '520px',
    options: {
        disableDoubleClickZoom: true,
        zoom: 20,
        zoomControlOptions: {
            position: 'google.maps.ControlPosition.LEFT_CENTER',
            style: 'google.maps.ZoomControlStyle.LARGE'
        }
    }
} %}
    {{ craft.googleMaps.map(options) }}
    {{ craft.googleMaps.data(mapID, blocoMapa) }}

I think the problem is on: "initializeApi: function() {" it should be "initializeApi: function(map) {"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions