Here is Google Maps T1 code with working zoom, markers and per-marker styling, image type and other stuff. All that's left is calculating relative marker clicks and mouse-overs(PC only) from center coordinate and bitmap size. Maybe not bitmap size since out-of-view markers won't matter.
I also need to calculate markers in view in PHP given center coord on my server but can do code for that before DB query. I want to only stream marker meta data in view given zoom and bitmap size.
I would of edited my last post but it's taking days to get me posts approved so it's not visible for editing..
SetDisplayAspect(0)
spr=GetMap(37.352741, -122.006422, "12", "hybrid", "800x480", "true", "&markers=color:0x00ff00|size:mid|37.352741,-122.006422&markers=color:0x0000ff|size:mid|37.352860,-122.002130")
wheel#=GetRawMouseWheel()
zoom=12
do
if getpointerpressed()=1 then exit
if GetRawMouseWheel()<>wheel#
if GetRawMouseWheel()>wheel# and zoom<21
inc zoom,1
spr=GetMap(37.352741, -122.006422, str(zoom), "hybrid", "800x480", "true", "&markers=color:0x00ff00|size:mid|37.352741,-122.006422&markers=color:0x0000ff|size:mid|37.352860,-122.002130")
endif
if GetRawMouseWheel()<wheel# and zoom>0
dec zoom,1
spr=GetMap(37.352741, -122.006422, str(zoom), "hybrid", "800x480", "true", "&markers=color:0x00ff00|size:mid|37.352741,-122.006422&markers=color:0x0000ff|size:mid|37.352860,-122.002130")
endif
wheel#=GetRawMouseWheel()
endif
Sync()
loop
remstart
-Each marker can have it's own style ex: &marker=color:0xFFFFCC|size:mid|37.352741,-122.006422
-Parameters: lat, long, zoom(0-21), style(terrain|satellite|roadmap|hybrid), resolution(ex: 500x400), sensor(true or false), markers(see above)
-Not implemented but markers can be custom icons from URLs
-Sensor has no noticable effect on anything
NOTE: set lat to street address and leave long blank to use address rather than lat&long
remend
function GetMap(n#, e#, zoom$, style$, resolution$, sensor$, markers$)
//English
//https://developers.google.com/maps/documentation/imageapis/?hl=en
//German
//https://developers.google.com/maps/documentation/imageapis/?hl=de
spr=0
szHost$="maps.googleapis.com"
iHTTP= CreateHTTPConnection()
ret=SetHTTPHost(iHTTP, szHost$,0)
if len(str(e#))>0
center$=HTTPEncode(str(n#))+","+HTTPEncode(str(e#))
else
center$=HTTPEncode(str(n#))
endif
szServerFile$="maps/api/staticmap?center="+center$+"&zoom="+zoom$+"&size="+resolution$+"&sensor="+sensor$+"&maptype="+HTTPEncode(style$)+markers$
szLocalFile$="map.png"
szPostData$=""
f=GetHTTPFile( iHTTP, szServerFile$, szLocalFile$, szPostData$ )
ok=0
do
p#=GetHTTPFileProgress(iHTTP)
print("download ... " + str(p#))
ok=GetHTTPFileComplete(iHTTP)
if ok=1 then exit
if ok=-1 then exit
Sync()
loop
CloseHTTPConnection( iHTTP )
DeleteHTTPConnection( iHTTP )
if ok=1
spr=ShowImage(szLocalFile$)
else
spr=createsprite(0)
setspritecolor(spr,255,0,0,255)
endif
endfunction spr
function ShowImage(szLocalFile$)
spr=LoadSprite(szLocalFile$)
setspritepositionbyoffset(spr,50,50)
setspritesize(spr,-1,100)
endfunction spr