On the Map Card here is the script
Code: Select all
global gScreenSize, gScreenCenterLoc, gResizeStackHorizontal, gResizeStackVertical, gDeviceHasNetworkConnection, gDeviceHasInternetConnection
global gServerName, gMainApplicationArchiveFilename, gMainApplicationFilename, gSplashAppVersion, gApplicationPrefsDir, gProgramAppUpdateArray
global gMainAppDownload, gMainAppExtracted, gOrgAvailableMarketsArray, gOrgAvailableMarketTowersArray
global gAreaBTALatitude, gAreaBTALongitude, gAreaCallSign, gAreaCity, gAreaState
global gDecLatitude, gDecLongitude, gBrowserID
on openCard
local tMapURL
put "Viewing Map for: " into field "Map Heading" on me
put gAreaCity & "," && gAreaState && "(" & gAreaCallSign & ")" after field "Map Heading"
-- If any open browsers lets close them
resetCard
-- Create the Browser Object
lock messages
put the windowID of this stack into gBrowserID
unlock messages
if gBrowserId is not an integer then
answer "Failed to open browser"
else
-- This links or sets the rec area of the browser to the rec area of the BrowserBackground
put gServerName & "/LivecodeApps/EBSLicenseMapApp/MapDisplay.cfm?" into tMapURL
put "CLat=" & gDecLatitude & "&" after tMapURL
put "CLon=" & gDecLongitude & "&" after tMapURL
put "MarkerTitle=" & gAreaCallSign after tMapURL
put revBrowserOpen(gBrowserID, tMapURL) into tBrowserID
revBrowserSet tBrowserID, "rect", the rect of image "BrowserArea"
-- revBrowserSet lBrowserID, "url", tMapURL
end if
end openCard
on preOpenCard
end preOpenCard
on resetCard
-- Clears the browser from the screen and memory
closeBrowsers
-- Set top Full Width
set the rect of image "BrowserArea" to 14,28,1014,702
end resetCard
on closeBrowsers
-- Close all browser in memory
repeat for each item gBrowserID in revBrowserInstances()
revBrowserClose gBrowserID
end repeat
end closeBrowsers
on closeCard
closeBrowsers
end closeCard
Then on the button which is on the same card the code is
Code: Select all
global gScreenSize, gScreenCenterLoc, gResizeStackHorizontal, gResizeStackVertical, gDeviceHasNetworkConnection, gDeviceHasInternetConnection
global gServerName, gMainApplicationArchiveFilename, gMainApplicationFilename, gSplashAppVersion, gApplicationPrefsDir, gProgramAppUpdateArray
global gMainAppDownload, gMainAppExtracted, gOrgAvailableMarketsArray, gOrgAvailableMarketTowersArray
global gAreaBTALatitude, gAreaBTALongitude, gAreaCallSign, gAreaCity, gAreaState
global gDecLatitude, gDecLongitude, gBrowserID
on mouseUp
get revBrowserCallScript(gBrowserID, "DisplayAlert()", "Testing from Livecode")
put the result into it
end mouseUp