HTMLviewer Problem Updated

I have 2 projects open and copied some information from one to the other.
I the first project inspector/control Set there are 2 options Renderer and InitialParent.
Settings are:
Renderer is set as: Native
InitialParrent is set as: MapBackgroundRectangle

In the second project inspector/control Set there is only one option Renderer
Renderer is set as Native
InitialParent does not even show.

How do I get it to show and set a value in it ?

What kind of control ?
And where did this project start out ?

It’s an HTML viewer. I am trying to do google maps. I have it working great on windows but the mac is giving me problems.
I copied the routine from one of the examples but insted of having the maps on the main window I am opening a new window
and passing the code to it. On the mac it does not work so good and the mouse does not show when over a map.

Forgot to add, also am using a Rectangle with an htmlviewer inside it.

Another problem on the mac is when a map is showing and you move the window just a little
the map will disappear and your left with a blank frame. If I close the window and reopen it the
map will come back until you move the window again. If I do not have the rectangle around the
htmlviewer the map will not disappear when you move the window.

Any ideas ?

Initial parent is one that you set simply by dragging the control into / onto it’s parent.
Its been that way for some time (since before 2011r4)
You’ll see the parent control highlight when you drag the HTMLViewer around
It’s not something you can type in a control name because we had people do some very interesting things (like put a control visibly on on but type in the parent as a different one

Still working on this MAC OSx HTMLviewer problem…

OK for those of you that think I’m nuts I have recreated this problem in a small program that
you can download and test and maybe someone might have an answer.
The problem is stated in the program as well.

The program was written in RS2012r2.1 but will work the same way in the new XOJO versions as well.

Please download and test it for yourself. QuickMapTest.rbp.zip

The map disappearing is due to the rectangle… Delete that and it stops disappearing…

The disappearing cursor is due to them using a custom cursor and it is not loaded in your application…

How can I get by the custom cursor or how can I get it and load it in my program ?

http://maps.gstatic.com/mapfiles/openhand_8_8.cur

Thanks Shao. I am not sure how to use it in the HTMLviewer though.

Any direction would be helpfull.

In theory it should just work, but in practice it doesn’t… I wrote another script to use that cursor and it worked fine, so there must be something else going on…
The only other way I found to get around this issue was through the use of the setOptions function in the API…

Sub DocumentComplete(URL as String) #if TargetMacOS me.ExecuteJavaScript "map.setOptions({draggableCursor: '-webkit-grab'});" me.ExecuteJavaScript "map.setOptions({draggingCursor: '-webkit-grabbing'});" #endif End Sub

Sorry to keep asking about this but I am not experienced enough to get it right.

Will this routine work in a desktop app ? I tried it and it errors. According to the LR manual
the ExecuteJavaScript is for Web applications. And when trying to add the hand cursor to the
app it won’t except it either. Did you by any chance try this routine in my test app QuickMapTest App ?

I always try it before I post… Go to the HTMLViewer on the Window, add the DocumentComplete event and then put the code in

#if TargetMacOS me.ExecuteJavaScript "map.setOptions({draggableCursor: '-webkit-grab'});" me.ExecuteJavaScript "map.setOptions({draggingCursor: '-webkit-grabbing'});" #endif

ExecuteJavaScript works on the desktop as well, otherwise my program wouldn’t work at all :wink:

Shao, Thank you. That works like a charm. I was putting the code you provided in the wrong
place. It is so nice to be able to see the cursor over the maps now. Your a life saver.

I have redone the QuickMapTest project and used Separators around the map to give it that
framed in look. I think this little project would be a good example for others. You can download
it from here. QuickMapTestFinal.zip

Again thanks for all the help guys…

Good to hear that it is working for you :slight_smile:

Hello Shao

Well it is half working. On my map window when it opens it displays the road map in the HTMLViewer
and with the code you provided it works good, BUT on that same window I have a pushbutton that
loads the weather map in the same HTMLViewer, but it’s now back to the same problem of no cursor and
it does hit the code for the hand but does not work for the weather map but if you push the button again
to go back to the road map it works good. Isn’t the weather map the same as the road map ?

No idea… You will need to do what I did and read the API documentation and search on Google…

Thanks Shao… I spent a couple of hours researching google and did find what you
posted but nothing if a weather map is shown. Anyway the road map was the most
important and that is working great.

Thanks again Shao.

I have updated this Map program example for those that want maps in an HTMLViewer.
It also has Latitude and Longitude coordinates for the weather map. The cursor works
great on Mac and Windows but the weather map still has an issue and I was not able to
find a fix if there is even one. The cursor does work on the weather map if run in Windows.

You can download the Maps Example here.

I think this is a good example myself… My 2 cents worth anyway.