UWP MapControl Tap/Click events not firing
I can't get the UWP MapControl to fire events such as Tapped or DoubleTapped MapElementClick ETC.GotFocus is firing ok.
<maps:MapControl
Name="myFirstMap"
Grid.Row="1"
Margin="10"
DoubleTapped="myFirstMap_DoubleTapped"
IsDoubleTapEnabled="True"
IsTapEnabled="True"
MapElementClick="MyFirstMap_MapElementClick"
MapServiceToken="myKey"
Tapped="myFirstMap_Tapped" />
</Grid>
</Grid>
I must be doing something daft any ideas? Event handled in code behind.
private void myFirstMap_DoubleTapped(object sender, doubleTappedRoutedEventArgs e)
//nothing happening here?!
Tried attaching GotFocus and that is firing. Seems very odd.
It's all working except for the events. .
uwp
add a comment |
I can't get the UWP MapControl to fire events such as Tapped or DoubleTapped MapElementClick ETC.GotFocus is firing ok.
<maps:MapControl
Name="myFirstMap"
Grid.Row="1"
Margin="10"
DoubleTapped="myFirstMap_DoubleTapped"
IsDoubleTapEnabled="True"
IsTapEnabled="True"
MapElementClick="MyFirstMap_MapElementClick"
MapServiceToken="myKey"
Tapped="myFirstMap_Tapped" />
</Grid>
</Grid>
I must be doing something daft any ideas? Event handled in code behind.
private void myFirstMap_DoubleTapped(object sender, doubleTappedRoutedEventArgs e)
//nothing happening here?!
Tried attaching GotFocus and that is firing. Seems very odd.
It's all working except for the events. .
uwp
"ubleTappedRoutedEventArgs e". Is that a typo in your question or a typo in your code?
– Adam McMahon
Nov 14 '18 at 12:22
Typo sorry about that!
– Paul Stanley
Nov 14 '18 at 12:28
Can you post your full XAML - Something else is probably stopping it from firing as the above code works fine for me, without the grid.
– Adam McMahon
Nov 14 '18 at 12:36
add a comment |
I can't get the UWP MapControl to fire events such as Tapped or DoubleTapped MapElementClick ETC.GotFocus is firing ok.
<maps:MapControl
Name="myFirstMap"
Grid.Row="1"
Margin="10"
DoubleTapped="myFirstMap_DoubleTapped"
IsDoubleTapEnabled="True"
IsTapEnabled="True"
MapElementClick="MyFirstMap_MapElementClick"
MapServiceToken="myKey"
Tapped="myFirstMap_Tapped" />
</Grid>
</Grid>
I must be doing something daft any ideas? Event handled in code behind.
private void myFirstMap_DoubleTapped(object sender, doubleTappedRoutedEventArgs e)
//nothing happening here?!
Tried attaching GotFocus and that is firing. Seems very odd.
It's all working except for the events. .
uwp
I can't get the UWP MapControl to fire events such as Tapped or DoubleTapped MapElementClick ETC.GotFocus is firing ok.
<maps:MapControl
Name="myFirstMap"
Grid.Row="1"
Margin="10"
DoubleTapped="myFirstMap_DoubleTapped"
IsDoubleTapEnabled="True"
IsTapEnabled="True"
MapElementClick="MyFirstMap_MapElementClick"
MapServiceToken="myKey"
Tapped="myFirstMap_Tapped" />
</Grid>
</Grid>
I must be doing something daft any ideas? Event handled in code behind.
private void myFirstMap_DoubleTapped(object sender, doubleTappedRoutedEventArgs e)
//nothing happening here?!
Tried attaching GotFocus and that is firing. Seems very odd.
It's all working except for the events. .
uwp
uwp
edited Nov 14 '18 at 13:53
Paul Stanley
asked Nov 14 '18 at 12:06
Paul StanleyPaul Stanley
633722
633722
"ubleTappedRoutedEventArgs e". Is that a typo in your question or a typo in your code?
– Adam McMahon
Nov 14 '18 at 12:22
Typo sorry about that!
– Paul Stanley
Nov 14 '18 at 12:28
Can you post your full XAML - Something else is probably stopping it from firing as the above code works fine for me, without the grid.
– Adam McMahon
Nov 14 '18 at 12:36
add a comment |
"ubleTappedRoutedEventArgs e". Is that a typo in your question or a typo in your code?
– Adam McMahon
Nov 14 '18 at 12:22
Typo sorry about that!
– Paul Stanley
Nov 14 '18 at 12:28
Can you post your full XAML - Something else is probably stopping it from firing as the above code works fine for me, without the grid.
– Adam McMahon
Nov 14 '18 at 12:36
"ubleTappedRoutedEventArgs e". Is that a typo in your question or a typo in your code?
– Adam McMahon
Nov 14 '18 at 12:22
"ubleTappedRoutedEventArgs e". Is that a typo in your question or a typo in your code?
– Adam McMahon
Nov 14 '18 at 12:22
Typo sorry about that!
– Paul Stanley
Nov 14 '18 at 12:28
Typo sorry about that!
– Paul Stanley
Nov 14 '18 at 12:28
Can you post your full XAML - Something else is probably stopping it from firing as the above code works fine for me, without the grid.
– Adam McMahon
Nov 14 '18 at 12:36
Can you post your full XAML - Something else is probably stopping it from firing as the above code works fine for me, without the grid.
– Adam McMahon
Nov 14 '18 at 12:36
add a comment |
1 Answer
1
active
oldest
votes
Another two hours of my life I will never get back!
Do not use:
Tapped="EventHandler"
But
MapTapped="EventHandler"
There is a difference between the events Tapped and DoubleTapped and MapTapped and MapDoubleTapped.
1
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
1
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
1
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53299874%2fuwp-mapcontrol-tap-click-events-not-firing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Another two hours of my life I will never get back!
Do not use:
Tapped="EventHandler"
But
MapTapped="EventHandler"
There is a difference between the events Tapped and DoubleTapped and MapTapped and MapDoubleTapped.
1
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
1
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
1
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
add a comment |
Another two hours of my life I will never get back!
Do not use:
Tapped="EventHandler"
But
MapTapped="EventHandler"
There is a difference between the events Tapped and DoubleTapped and MapTapped and MapDoubleTapped.
1
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
1
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
1
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
add a comment |
Another two hours of my life I will never get back!
Do not use:
Tapped="EventHandler"
But
MapTapped="EventHandler"
There is a difference between the events Tapped and DoubleTapped and MapTapped and MapDoubleTapped.
Another two hours of my life I will never get back!
Do not use:
Tapped="EventHandler"
But
MapTapped="EventHandler"
There is a difference between the events Tapped and DoubleTapped and MapTapped and MapDoubleTapped.
edited Nov 14 '18 at 14:01
answered Nov 14 '18 at 13:52
Paul StanleyPaul Stanley
633722
633722
1
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
1
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
1
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
add a comment |
1
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
1
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
1
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
1
1
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
Yes, but you mentioned that MapElementClick wasn't firing either?
– Adam McMahon
Nov 14 '18 at 14:00
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
That does not appear to be working.
– Paul Stanley
Nov 14 '18 at 14:04
1
1
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
According to MSDN - MapElementClick occurs when the user taps the MapControl or clicks on it with the left mouse button. I believe your MapTapped event will override this as MapTapped also handles mouse clicks.
– Adam McMahon
Nov 14 '18 at 15:01
1
1
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Which also explains why my test worked as I tested the MapElementClick event on my non-touch PC rather than the non-working tap events. Problem solved :)
– Adam McMahon
Nov 14 '18 at 15:04
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
Hi @PaulStanley if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself.
– CoCaIceDew
Dec 5 '18 at 8:55
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53299874%2fuwp-mapcontrol-tap-click-events-not-firing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
"ubleTappedRoutedEventArgs e". Is that a typo in your question or a typo in your code?
– Adam McMahon
Nov 14 '18 at 12:22
Typo sorry about that!
– Paul Stanley
Nov 14 '18 at 12:28
Can you post your full XAML - Something else is probably stopping it from firing as the above code works fine for me, without the grid.
– Adam McMahon
Nov 14 '18 at 12:36