question

GaryF-6452 avatar image
0 Votes"
GaryF-6452 asked ·

Why is Bing Maps API mouse click event so slow for mobile?

The mouse click event has a long delay on it when used on mobile devices, or emulated through Edge/Chrome dev tools. How can this delay be removed please?
https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk/mapmouseevents#JS
You'll notice the delay using the demo above.
This is made worse when I have a number of polygons that can be selected by the user. A user taps and then 1 second goes by before the click event changes the colour of the selected polygon. It's gives a really bad user experience.

Hopefully someone knows what Microsoft did to make the event run slower on mobile and how to undo it please.
Thanks.
Gary.

P.S. Why are there still no tags in this forum for Bing Maps API?

windows-maps
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @GaryF-6452 Checking in to see if the below answer helped <solve your problem>/<Answer your question>.

Please comment in the below section to get more help in this matter.

0 Votes 0 ·
GaryF-6452 avatar image GaryF-6452 SatishBoddu-MSFT ·

Hi @SatishBoddu-MSFT ,
I would really appreciate your help in escalating my question to a developer or engineer in the Maps API team please? It's been nearly 4 weeks since I posted the question.

Thanks.
Gary.

0 Votes 0 ·

3 months on there's no answer. 😢 Please can someone help? Is anyone from the Bing Maps team here?

0 Votes 0 ·
IoTGirl avatar image
0 Votes"
IoTGirl answered ·

Hi Gary,

"Bing Maps" is a consumer product so there will not be a tag created here for that product. That product is supported at Answers.Microsoft.com > Bing > Maps. "Bing Maps for Enterprise" or API questions can be asked under either the "Windows-Maps" tag or "Azure-Maps" tags as it is the Microsoft Maps & Geospatial team that covers all Maps API questions.

As for the "JS" event on the Bing Maps V8 control, I will ask the team for their insights and get back to you here.

Sincerely,
IoTGirl

· 8 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @IoTGirl ,

Did the Maps team get back to you please? I need to disable whatever they did to delay a click event when the API thinks it's on a mobile device. I don't understand why they did that without documenting it or a way to turn off the delay.

Please help.
Thank you.
Gary.

0 Votes 0 ·

Sorry, nothing yet. Have you done any further digging to see what particular actions show the delay? Do different mobile browsers provide different experience?

0 Votes 0 ·

I believe the maps API checks if it's running on mobile and then implements a delay on click events. As I said in my original post, you can run the event demo in a desktop browser:
https://www.bing.com/api/maps/sdk/mapcontrol/isdk#polygonAllEvents+JS

Then use dev tools (hit F12), then press the mobile emulator button, press F5 to reload the demo, and the click event will become subject to a delay.

This happens in emulated and real mobile browsers.

I'd be very grateful if you can chase up the Maps team to ask why it does this and how to remove the delay. Perhaps some undocumented javascript will do the trick. Thanks.

0 Votes 0 ·
Show more comments

Hello @IoTGirl .

It's been 9 days since your last reply. Have the Maps API team not got back to you yet? Is there a way this can be escalated please?

Thank you.
Gary

0 Votes 0 ·
Show more comments
IoTGirl avatar image
0 Votes"
IoTGirl answered ·

Hi @GaryF-6452,

We have been unable to see the delay. Here are the steps that we used:

  1. Open the iSDK and choose Getting started > Events > Polygon all events

  2. Use the map, click, move etc

  3. repeat with other browsers / Mobile devices

Result: No delay, worked as fast or faster than the built in app

I personally used multiple Android phones with multiple browsers and saw no delay. My assumption is the delaty is somewhere in your network of debug setup.

Sincerely,
IoTGirl




· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi IoTGirl,

There is no problem with my networks - fiber broadband and 4G. API events do not require a network connection in order to trigger correctly so I'm not sure why you mentioned networks? Debug on or off makes no difference.

I've also tested using a borrowed iPhone with Safari and that too has a delay on click events. Maybe being in a different timezone to you is part of the bug! LOL!

As a reluctant fix I've changed my code to use the mouseup event instead of click. Not sure if there will be any consequences to that so I'll do some testing.

0 Votes 0 ·
IoTGirl avatar image
0 Votes"
IoTGirl answered ·

Hi @GaryF-6452,

Did the Mouse Up work? There is obviously some architecture difference in what you are doing that we can't replicate here.

Sincerely,
IoTGirl

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @IoTGirl .
Yes, mouseup works well after testing. I'm still confused why you couldn't see the problem for yourself with click. I tried the Microsoft hosted web page on at least 6 different iOS and Android devices of different ages and they all exhibited the delay. Maybe a different version of that web page is served up to users in the UK. LOL! I can't think of any other explanation.
Anyway, at least the workaround works.

Thanks,
Gary.

0 Votes 0 ·