gmAPI and JSON customization

  • Hi,
    I'm trying to customize a google maps using gmAPI of Google Maps Plugin and JSON instructions, but I have no effect.

    Code
    <action name="gmapi_test" type="Javascript"><![CDATA[	    var gmAPI = caller.gmAPI;	    if (gmAPI)	    {	        gmAPI.map.setOptions({ 			styles: stylers			});	    }		var stylers = [{		  "stylers": [, { ... }]		}];]]></action>


    What am I doing wrong?

    Thank you!
    Matteo

  • Hi,
    I call it in a <plugin> and it works:

    Code
    <plugin name="map"
    ...
    onmapready="gmapi_test();"
    >
    </plugin>

    I can load a map and se Lat and Long, for example:

    but it doesn't work if I try to set the variable with JSON options:

    Thank you!

  • No way *sad*

    Lat, lng, zoom, maptype are ok, but no style...

    Code
    gmAPI.map.setOptions({
    center: {lat: 45.433651, lng: 12.339663},
    zoom: 12,
    mapTypeId: 'roadmap',
    styles: [{elementType: 'geometry', stylers: [{color: '#242f3e'}]}] 
    });

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!