Google Maps

<%
ShortName = Request.QueryString("Name")
BaseZoom = 0

Header = ""
Footer = ""

If Request.QueryString("Zoom") & "" <> "" Then
BaseZoom = CInt(Request.QueryString("Zoom"))
End If
If Request.QueryString("Version") & "" <> "" Then
Version = Request.QueryString("Version") ' Simple
Else
Version = "Full"
End If

Dim map_bound(16)

map_bound(15) = 0.0761
map_bound(14) = 0.1472
map_bound(13) = 0.2182
map_bound(12) = 0.2893
map_bound(11) = 0.4004
map_bound(10) = 0.8814
map_bound(9) = 1.1325
map_bound(8) = 1.2936
map_bound(7) = 46.1319
map_bound(6) = 90.9702
map_bound(5) = 135.808
map_bound(4) = 180.646
map_bound(3) = 225.485
map_bound(2) = 270.323
map_bound(1) = 315.161

Set objConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
objConn.Open "DSN=" & data_source

sSQL="SELECT Locations.Header, Locations.Footer, MapNames.MapName, AVG(MapItems.co_lat) AS center_lat, AVG(MapItems.co_long) AS center_long, MIN(MapItems.co_lat) AS min_lat, MIN(MapItems.co_long) AS min_long, MAX(MapItems.co_lat) AS max_lat, MAX(MapItems.co_long) AS max_long FROM (Locations INNER JOIN MapNames ON Locations.LocationID = MapNames.LocationID) INNER JOIN MapItems ON MapNames.MapID = MapItems.MapID WHERE MapNames.ShortName = '" & ShortName & "' GROUP BY Locations.Header, Locations.Footer, MapNames.ShortName, MapNames.MapName"

RS.Open sSQL,objConn
If Not(RS.EOF) Then
If RS("center_lat") > 0 Then
center_lat = RS("center_lat") + 0.00264 ' (make it a little more northernly)
Else
center_lat = RS("center_lat") - 0.00264 ' (make it a little more southernly)
End if
center_long = RS("center_long")
min_lat = RS("min_lat")
min_long = RS("min_long")
max_lat = RS("max_lat")
max_long = RS("max_long")
MapName = RS("MapName")
Header = RS("Header")
Footer = RS("Footer")
End If
RS.Close
Set RS=Nothing
objConn.Close
Set objConn=Nothing

If BaseZoom = 0 then
bound_lat = abs(max_lat - min_lat)
bound_long = abs(max_long - min_long)

If bound_lat > bound_long Then
max_bound = bound_lat
Else
max_bound = bound_long
End If

' response.write("used " & max_bound & "
")

mb = 16
Do While ((BaseZoom = 0) And (mb > 0))
' response.write((map_bound(mb) * 10000) & " vs. " & (max_bound * 10000) & "
")
If map_bound(mb) > max_bound Then
mb = mb - 2
BaseZoom = mb
End If
mb = mb - 1
Loop
End If

%>


Maps - <% =MapName %>



<% =Header %>
<% if Version <> "Simple" Then %>

<% =MapName %>

<% End If %>

<%
Set objConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
objConn.Open "DSN=" & data_source

sSQL="SELECT DISTINCT MapItems.* FROM MapNames,MapItems WHERE MapNames.ShortName = '" & ShortName & "' AND MapNames.MapID=MapItems.MapID"
RS.Open sSQL,objConn
Do While Not(RS.EOF)
%>

<% =RS("title") %>

<% =RS("description") %>

<%
RS.MoveNext
Loop
RS.Close
%>

<% if Version <> "Simple" Then %>

<% Else %>

<% End If %>

<% if Version <> "Simple" Then %>

Maps

    <%
    sSQL="SELECT DISTINCT MapNames.* FROM MapNames,MapItems WHERE MapNames.MapID=MapItems.MapID"
    RS.Open sSQL,objConn
    Do While Not(RS.EOF)
    If RS("Shortname") = Shortname Then
    %>
  • <% =RS("Mapname") %>
  • <% else %>

  • "><% =RS("Mapname") %>
  • <%
    End If
    RS.MoveNext
    Loop
    RS.Close
    %>

<% End If %> 

<% =Footer %>
<%
Set RS=Nothing
objConn.Close
Set objConn=Nothing
%>


Social And Stats

My Brand Yourself-- no wait, that doesn't make sense!

 
eXTReMe Tracker