Google-Maps-for-Craft
Google-Maps-for-Craft copied to clipboard
Bug on Route and setting map ID
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) {"