To keep this brief, I am trying to do mapping with an open source, JavaScript system called “Polymaps”. Currently, I have an HTMLViewer that on an open event would, optimistically, have the multiline JavaScript executing…
I have tried this and searched Google for decent examples of people getting JavaScript to work on Xojo, but haven’t found it to be of much help.
Could someone help me walk through getting multiline JavaScript to actually execute?
To use Polymaps you use the WebSDK to create a custom WebControl that embed the Polymaps javascript library and creates a control using the javascript as documented in the Polymaps.org site.
The docs for WebSDK is in the “Extras\WebSDK” folder contained in the Xojo installation directory.
The final result depends on your knowledge about javascript and html.
[quote=353812:@Maurizio Rossi]To use Polymaps you use the WebSDK to create a custom WebControl that embed the Polymaps javascript library and creates a control using the javascript as documented in the Polymaps.org site.
The docs for WebSDK is in the “Extras\WebSDK” folder contained in the Xojo installation directory.
The final result depends on your knowledge about javascript and html.[/quote]
Oh jeez. Just looked at the documentation. Looks like this is going to be a long project!
Getting back to the matter at hand… I played around with it a lot and it is only making me feel stupid (which, I contend that, I am not).
Where I am thus far:
I made a WebControlWrapper titled “HTMLArea” with the following…
JavascriptNamespace as (Constant) String = Mapping
HTML as (Computed) String
Get = //empty
Set = mHTML = value
if ControlAvailableInBrowser() then
ExecuteJavaScript("Xojo.get('" + me.ControlID + "').innerHTML = '" + value + "';")
end
mHTML as (Private) String
Event Handlers:
SetupCSS = Styles(0).Value("visibility") = "visible"
SetupHTML = Return "<div id=""" + self.ControlID + """>" + html + "</div>"
In my appropriately named “MainWindow”, I have the following…
“MappingHTMLArea” (Super = “HTMLArea”)
Open (event handler): [code]if AssetDataListBox.RowCount < 1 then //if no assets…
Me.HTML = “
Is it not working?
By the way, I made a little tool that helps make empty WebControlWrappers so that you don’t miss anything important: http://webgen.timi.me
[quote=353982:@Tim Parnell]Is it not working?
By the way, I made a little tool that helps make empty WebControlWrappers so that you don’t miss anything important: http://webgen.timi.me[/quote]
No sir, it is not working… I am going for their “Nasa” style map pictured at this link:
Instead, I got a whole lot of white…
I followed it to a point (see above)… Where it started veering off of my objectives for the code, I began varying the code.