Premise Question on Automation Browser Sizing...

Motorola Premise

etc6849

Senior Member
I'm trying to add a weather radar page in Premise. However, the premise automation browser resizes when I first open it. The problem is it resizes the iframe to a much larger value than the pixels it is set for and the page I'm displaying won't change size as its in flash. This means the new area is black surrounding the weather radar flash plugin. Is there a way to prevent this? I've tried adding a background tags to atleast change the color and possibly set it to transparent, but it didn't work. Attached is a picture of the issue. Keep in mind that the page displays perfectly if displaying 800x600 and not resized (not sure what's doing the resizing).

My code is below and I'm using the dlink camera driver:

if not sysevent.ClientSession is nothing then
strOutput = "<div STYLE=" & chr(34) & "Position: absolute; Left:7px; Top:-60px" & chr(34) & ">"
strOutput = strOutput + "<iframe src =" & chr(34) & "http://image.weather.com/web/flash/FMMain.swf?&lat=41.79&long=-88.16&viewPortWidth=400&viewPortHeight=300&initialWeatherLayerType=satrad&initialZoomLevel=8&wxAnimateOnStart=true" & chr(34)
strOutput = strOutput + " width=" & chr(34) & "400px" & chr(34) & " height=" & chr(34) & "420px" & chr(34) & " marginwidth=" & chr(34) & "0" & chr(34) & " marginheight=" & chr(34) & "0" & chr(34) & " scrolling=" & chr(34) & "no" & chr(34) & " frameborder=" & chr(34) & "0" & chr(34)
strOutput = strOutput + "</iframe>"
method.RenderHTML = strOutput
end if
 

Attachments

  • backgroundproblem.jpg
    backgroundproblem.jpg
    90.5 KB · Views: 27
... the premise automation browser resizes when I first open it. ... it resizes the iframe to a much larger value than the pixels it is set for ...
There's Javascript code in ..\SYS\web\Platforms\Desktop\default.htm that resizes the web page based on a reference of 800x600. Everything on the web-page is scaled to fit the available screen size. If the screen-size is 1024x768 then the browser magnifies everything. If the screen-size if less than 800x600 then the browser will shrink everything. This is a handy feature except in the case you've encountered: objects embedded in an iframe don't auto-size.

I haven't found a way to make the embedded object auto-size itself. I simply change the dimensions of the embedded object and display it at a fixed resolution. For example, the attached image shows the weather map when viewed on my laptop's browser. The gray border on the top and left are not normally seen on my touchscreen ... I use offsets that hide these borders ... but they are visible here because the auto-sizing has changed the dimensions. In other words, I tweak it to fit the resolution of my touchscreen ... and live with whatever it looks like on other PCs in the house.

Here's the code I use in my Environment Canada Weather module (hard-coded for Montreal, QC):
Code:
dim sHTML: sHTML = ""

sURL = "http://image.weather.com/web/flash/FMMain.swf?lat=45.47&long=-73.75&initialWeatherLayerType=radar&viewPortWidth=775&viewPortHeight=560&initialZoomLevel=8&wxAnimateOnStart=true&baseMap=h"

sHTML = sHTML & ("<embed src=" & sURL & " width=775 height=560></embed>")
ViewPortHeight and ViewPortWidth control the size of the weather map. Width and Height control the size of the window that displays the embedded object. In this case, Width and Height are large values because I have Premise Browser running at 1024x768.
 

Attachments

  • Interactive_Weather_Map.jpg
    Interactive_Weather_Map.jpg
    98.2 KB · Views: 20
The graphics in Premise don't look very good when you resize larger anyway so I can live with its limitations.
It would be nice if you could use vector graphics in the GUI so they scale nice. Most of my touchscreens are 8.4"
screens so I I just sized my weather map for the standard 800 x 600 GUI.

Weather-map-1.jpg
 
Very nice....so what are your touchscreens, how did you embed the image (I know iFrames...)?

Nice job!
 
Very nice....so what are your touchscreens, how did you embed the image (I know iFrames...)?

Nice job!

I use Fujitsu Stylistic P600s, they fit nicely on end tables and night stands, they were easy to find a few years ago.

I just used a webframe with the URL that 123 posted in this thread, you just need to change the Latitude and Longitude in the URL to match your area and set the width and height in the URL to fit inside the Frame.
 
Very nice....so what are your touchscreens, how did you embed the image (I know iFrames...)?

Nice job!

I used iframes, but embedding it as a object will also work. Thanks guys this is useful information. I figured it was something like 123 said, too bad I spent so many hours on trying to do something that is impossible :)

I did find a neat site that uses flash that actually resizes the weather page automatically! You have to manually start the animation though and reset the zoom level each time. If anyone figures out how to avoid setting the zoom and animation each time, I'd be very grateful. Some flash plug ins will resize automatically and I was really surprised to learn this. Screen shot is attached.

Example code and screen shots are below:

if not sysevent.ClientSession is nothing then
strOutput = "<DIV STYLE=" & chr(34) & "Position: absolute; Left:-10px; Top:-60px; background-color:transparent; Color:transparent; border-color:transparent;" & chr(34) & ">"
strOutput = strOutput + "<OBJECT>"
strOutput = strOutput + "<param name='movie' value='http://www.wunderground.com/swf/satblast.swf?lat=35.105598&lon=90.006989&firstcityname=&firststatename=&domain=www.wunderground.com&v=2.14'>"
strOutput = strOutput + "<embed src='http://www.wunderground.com/swf/satblast.swf?lat=35.105598&lon=90.006989&firstcityname=&firststatename=&domain=www.wunderground.com&v=2.14' width='598px' height='340px'></embed>"
strOutput = strOutput + "</OBJECT>"
strOutput = strOutput + "</DIV>"
method.RenderHTML = strOutput
end if
 

Attachments

  • wu_radar.JPG
    wu_radar.JPG
    97.6 KB · Views: 23
Back
Top