Google Map script syntax error

Iam using the following script in Qlikview to get a google map. But when I execute the following code,

// Google Maps Key
gmap_key =“;
max_zoom_level = 14;
Def_zoom_level=7;
Def_map_size=400;

// Variables required for calculating map
// No need to change these
var_pi180=      '=pi()/180';
var_lat_offset= '0';
var_mc2=        '=256*pow(2,$(var_zoom))';
var_mc1=        '=256*pow(2,($(var_zoom)-1))';
var_mid_lat=    '=median(latitude)';
var_mid_long=   '=median(longitude)';
var_zoom=       '=if(max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1-(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)’;
var_maptype=    '=if(isnull(only(maptype)),fieldvalue('&chr(39)&'maptype'&chr(39)&',4 ),maptype)';


SET HidePrefix='_' ;
// Field required for calcualting best zoom level
_zoom_level:
Load RecNo( ) as _zoom_level Autogenerate(max_zoom_level);

maptype:
LOAD * INLINE [
Maptype
roadmap
mobile
satellite
terrain
hybrid 
];

I get the following error,

Syntax error
Unexpected token: ')', expected nothing
var_zoom=       '=if(max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1-(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)’;
var_maptype=    '=if(isnull(only(maptype)>>>>>>)<<<<<<,fieldvalue('&chr(39)&'maptype'&chr(39)&',4 ),maptype)';

Can someone help me out?


ANSWERS:


You used wrong quote, that's right one :D

// Google Maps Key
gmap_key =“;
max_zoom_level = 14;
Def_zoom_level=7;
Def_map_size=400;

// Variables required for calculating map
// No need to change these
var_pi180=      '=pi()/180';
var_lat_offset= '0';
var_mc2=        '=256*pow(2,$(var_zoom))';
var_mc1=        '=256*pow(2,($(var_zoom)-1))';
var_mid_lat=    '=median(latitude)';
var_mid_long=   '=median(longitude)';
var_zoom=       '=if(max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1-(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)';
var_maptype=    '=if(isnull(only(maptype)),fieldvalue('&chr(39)&'maptype'&chr(39)&',4 ),maptype)';


SET HidePrefix='_' ;
// Field required for calcualting best zoom level
_zoom_level:
Load RecNo( ) as _zoom_level Autogenerate(max_zoom_level);

maptype:
LOAD * INLINE [
Maptype
roadmap
mobile
satellite
terrain
hybrid 
];


 MORE:


 ? Google maps api syntax error
 ? Google Maps distance server-side
 ? Google Maps distance server-side
 ? Google Maps distance server-side
 ? How to get distance from Google Map API from server side ASP.NET 2.0
 ? Pixel distance in Google Map (API V3) to avoid overlapping labels / overlays
 ? Google Maps handled server-side
 ? google maps distance matrix
 ? Google Distance Matrix distance differences with Google Map
 ? How to calculate distance using google maps?