Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapEvents.AddHandler MapEventArg vs MapMouseEventArgs #445

Open
larrywelch opened this issue Mar 2, 2017 · 0 comments
Open

MapEvents.AddHandler MapEventArg vs MapMouseEventArgs #445

larrywelch opened this issue Mar 2, 2017 · 0 comments

Comments

@larrywelch
Copy link

I'm implementing a control that will display pushpins on a bing map. When the user hovers or clicks on the pushpin I'd like to display an info box. I've been able to successfully register for and handle the event. However, the MapEventArg object doesn't contain enough data. Using the debugger I discovered that the object passed to the event handler was actually a MapMouseEventArg. Simple solution then, just cast the object to a MapMouseEventArg and finish up my code. Unfortunately that didn't work. Following is the js code that was produced:
IGT.AG.ClientUI.View.ContractsWithinRadiusView.mapPinClickEventHandler = function IGT_AG_ClientUI_View_ContractsWithinRadiusView$mapPinClickEventHandler(args) {
var m = Type.safeCast(args, MapEventArgs);
var mArgs = Type.safeCast(args, MapMouseEventArgs);
if (mArgs != null) {
if (mArgs.targetType === 'pushpin') {
...

The debugger reports that MapEventArgs is undefined. I can manually alter the resulting code to get it to work but I'd rather understand what I'm doing wrong, or fix something if it's broken.

Any help will be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant