Current release: 6.1.5
• For EE2 EE3 EE4 EE5
This is a legacy addon! This module has been replaced by Maps. No more new features will add to this module, only bugfixes.
Gmaps - JS API general
ExpressionEngine Code
{exp:gmaps:init} {exp:gmaps:map center:address="europa" width="100%" } $(function(){ EE_GMAPS.api('geocode', { address : 'heerde|apeldoorn|amsterdam', callback : function(result, type){ result = $.parseJSON(result); $.each(result, function(k,v){ EE_GMAPS.triggerEvent('addMarker', { mapID : 'ee_gmap_1', lat: v.latitude, lng: v.longitude, title: v.city }); EE_GMAPS.api('addCircle', { mapID : 'ee_gmap_1', lat: v.latitude, lng: v.longitude, fillColor : '#BBD8E9', fillOpacity : 0.3, radius : 7000, strokeColor : '#BBD8E9', strokeOpacity : 0.9, strokeWeight : 2, zIndex : 1 }); }); EE_GMAPS.api('geocode', { address : 'utrecht|hardewijk gelderland', callback : function(result, type){ result = $.parseJSON(result); EE_GMAPS.triggerEvent('addRectangle', { mapID : 'ee_gmap_1', bounds : [[result[0].latitude,result[0].longitude],[result[1].latitude,result[1].longitude]], fillColor : '#BBD8E9', fillOpacity : 0.3, strokeColor : '#BBD8E9', strokeOpacity : 0.8, strokeWeight : 2, zIndex : 1 }); } }); EE_GMAPS.api('fitZoom', { mapID : 'ee_gmap_1', zoomLevel : 9 }); } }); });