2016-12-02 109 views
-1

Iam使用以下腳本Qlikview得到一個谷歌地圖。但是,當我執行下面的代碼,谷歌地圖腳本語法錯誤

// 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 
]; 

我碰到下面的錯誤,

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)'; 

有人能幫助我嗎?

+0

你可以看到它在語法高亮這裏;最有可能的'var_zoom'行中的結束引用是錯誤的。使用語法突出顯示的編輯器立即捕獲這些內容。 –

回答

1

你用錯了報價,這是正確的: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 
];