Re: Obj-C from JavaScript, Google Map event listeners in a WebView.
Re: Obj-C from JavaScript, Google Map event listeners in a WebView.
- Subject: Re: Obj-C from JavaScript, Google Map event listeners in a WebView.
- From: Pierre Bernard <email@hidden>
- Date: Thu, 8 Feb 2007 17:53:08 +0100
Hi!
Did you ever get your Google Maps integration to work?
I am trying to do much the same. I want to display a WebView showing
Google Maps. From that web view I want to be able to determine a
location pointed out or flagged by the user.
Best,
Pierre
On 16 Jan 2006, at 18:13, Erik Sjödin wrote:
Hi!
I'm trying to execute a objective c method called "test" from a
JavaScript in a WebView. The code compiles fine but "test" is not
executed when the JavaScript is executed in the WebView.
I'm also trying to get google maps event listeners to work in my
WebView, I've tried both GEvent.addListener and GEvent.bind without
succes. My gmap loads fine in the WebView otherwise and the listeners
work in Safari...
Any Ideas?
----- objective c code:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)
frame {
id win = [webView windowScriptObject];
// alloc an instance of the mapManager class
MapManager *mapManager = [[MapManager alloc] init];
// publish mapManager to webView
[win setValue:mapManager forKey:@"gMapManager"];
}
------ javascript code:
<script type="text/javascript">
// exc. obj-c method
if (gMapManager) { gMapManager.test(); }
</script>
thanks! // erik
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden