{namespace nsgooglemap=Nitsan\NsGoogleMap\ViewHelpers} (function ($, window, document, undefined) { $(function () { var googlemap = new Object(); {f:uri.resource(path:'Images/', extensionName: 'NsGoogleMap')} {f:uri.resource(path:'Images/1.png', extensionName: 'NsGoogleMap')} {f:uri.resource(path:'Images/people35.png', extensionName: 'NsGoogleMap')} {f:uri.resource(path:'Images/conv30.png', extensionName: 'NsGoogleMap')} {f:uri.resource(path:'Images/heart30.png', extensionName: 'NsGoogleMap')} {f:uri.resource(path:'Images/pin.png', extensionName: 'NsGoogleMap')} googlemap.iconBase = "{iconBase}"; googlemap.placeIcon = "{placeIcon}"; googlemap.clusterVariance1 = "{clusterVariance1}"; googlemap.clusterVariance2 = "{clusterVariance2}"; googlemap.clusterVariance3 = "{clusterVariance3}"; googlemap.clusterVariance4= "{clusterVariance4}"; googlemap.zoomTypes = new Array(google.maps.ZoomControlStyle.DEFAULT, google.maps.ZoomControlStyle.SMALL, google.maps.ZoomControlStyle.LARGE); googlemap.defaultMapTypes = new Array(google.maps.MapTypeId.ROADMAP); googlemap.mapSettings = { id: 'map_' + {data.uid}, width : '100%', width : '{settings.width}', height : '500px', height : '{settings.height}', zoom: {f:if(condition:"{settings.zoom}", then:"{settings.zoom}", else:"0")}, scrollwheel: "true", scrollwheel:'false', draggable: {f:if(condition:"{settings.draggable}", then:"true", else:"false")}, doubleClickZoom: {f:if(condition:"{settings.doubleclickzoom}", then:"false", else:"true")}, markerCluster: {f:if(condition:"{settings.markercluster}", then:"1", else:"0")}, markerClusterZoom: {f:if(condition:"{settings.maxzoomlevel} != ''", then:"{settings.maxzoomlevel}", else:"null")}, markerClusterSize: {f:if(condition:"{settings.gridsize} != ''", then:"{settings.gridsize}", else:"null")}, markerClusterStyle: {settings.styles}, zoomControl: {f:if(condition:"{settings.zoomcontrol}", then:"true", else:"false")}, zoomControlOptions: { position: google.maps.ControlPosition.{settings.zoomcontrolposition} }, fullscreenControl: {f:if(condition:"{settings.fullscreencontrol}", then:"true", else:"false")}, fullscreenControlOptions: { position: google.maps.ControlPosition.{settings.screencontrolposition} }, defaultZoom: 11 } googlemap.mapSettings.mapTypes = new Array(); googlemap.mapSettings.mapTypes[{i.index}] = googlemap.defaultMapTypes['{type}']; googlemap.locations = new Array(); googlemap.locations[{i.index}] = { uid: {address.uid}, title: '{address.title}', latitude: {address.latitude -> f:format.number(decimals:6, thousandsSeparator:'')}, longitude: {address.longitude -> f:format.number(decimals:6, thousandsSeparator:'')}, address: '{address.address}', infoWindowContent: '', openByClick: {f:if(condition:"{address.openByClick}", then:"1", else:"0")}, closeByClick: {f:if(condition:"{address.closeByClick}", then:"1", else:"0")}, opened: {f:if(condition:"{address.opened}", then:"1", else:"0")}, position: new google.maps.LatLng({address.latitude -> f:format.number(decimals:6, thousandsSeparator:'')}, {address.longitude -> f:format.number(decimals:6, thousandsSeparator:'')}), } var $element = jQuery("#" + googlemap.mapSettings.id); $element.nsgooglemap(googlemap); if(googlemap.mapSettings.width.indexOf('%') != -1) { $(window).resize(function() { $element.trigger('mapresize'); }); } }); // end of closure })(jQuery || $, window, document);