Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Map help please!!!

Hello I am making a map for an app and I have a problem were the static image will change when the zoom is changed but the longitude and latitude don't so I end up with data points in the same place at every zoom

I am looking for a solution that allows me to change zoom and the longitude and latitude will change so that I can actually see the data points at every level

Here is my expressions:

Longitude - =SUM( round (256*pow(2,($(var_zoom)-1)))+( longitude  *((256*pow(2,$(var_zoom)))/360)) )

Latitude - =SUM(((256*pow(2,($(var_zoom)-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,$(var_zoom)))/(2*pi())))))

And this in my script:

// Google Maps Key

gmap_key = 'AIzaSyAASA7qdksCLnQJcvMlgrFvPi10puehhKc';

max_zoom_level = 14;

def_zoom_level = 7;

def_map_size = 401;

// Variables required for calculating map

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

// Calculate best zoom level

set HidePrefix = '_';

_zoom_level:

LOAD RecNo() as _zoom_level AutoGenerate(max_zoom_level);

maptype:

LOAD * INLINE [

  Maptype

  roadmap

  mobile

  satellite

  terrain

  hybrid

];

I really need the help and would appreciate anything 

0 Replies