* Map Life Facts plugin with Bing Maps support

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Map Life Facts plugin with Bing Maps support

Post by tatewise »

Please find attached Map Life Facts plugin Version 5.2.1 Date 11 Apr 2023 with Bing Maps support.

To cater for both Google Maps and Bing Maps as geocoders and Google Maps, Leaflet Maps & Bing Maps to display maps the Set Preference Options tab has been slightly reorganised. This will be explained in the Help & Advice when the plugin gets published. When first run by a user of an earlier plugin version, a popup message will alert the user to those changes.

The Location Plot Options tab now allows both Google Maps and Bing Maps API Keys to be entered.
One of them can be chosen as the Plot Geocoder or they can be Disabled.

The Web Page Map Options tab allows Leaflet Maps or Bing Maps to display the internal Plugin Map Pane.
Also, Google Maps, Leaflet Maps, or Bing Maps can be chosen to display maps in any browser Web Page Maps.

If either API Key is not entered then the associated Google Maps or Bing Maps options will not be accepted.
When the plugin is first run by a new user a popup message explains about entering those API Keys.

To obtain a free Bing Maps API Key visit https://www.bingmapsportal.com/ and follow the First time Bing Maps developer? advice.
You will need a free Microsoft Account (similar to a Google Account) with an Email address and Password.
After sign in use the Yes, let's create a new account link and enter the Account details required fields.
Use the My account > My Keys menu option and the Create Key form that needs the following settings:
Application Name: Map Life Facts
Key Type: Basic (no alternative)
Application Type: Windows Application
That creates a new 108-character key, so use Show key and Copy key to paste into the plugin.
You do not need to remain signed in to the Microsoft Account.
I found the explanation of what constitutes free use somewhat confusing but I think low-volume private use is free.

Currently, the Bing Maps marker pins do not cascade down and bounce as they do in Google & Leaflet Maps.
Instead, they just flash red. I'm working on the cascade & bounce features which are trickier in Bing Maps.
Also, the chosen Current Map Type such as Road, Aerial, or Ordnance Survey is not remembered from run to run.
However, I thought it worthwhile putting this prototype version out for feedback comments.
All other features seem to work similarly to Leaflet Maps including manually adding and moving marker pins.
Last edited by tatewise on 12 Apr 2023 13:50, edited 2 times in total.
Reason: Attachment deleted as better version is attached later. Create Key details added.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Gary_G
Megastar
Posts: 721
Joined: 24 Mar 2023 19:05
Family Historian: V7

Re: Map Life Facts plugin with Bing Maps support

Post by Gary_G »

Mike;

I downloaded and started to set up the version you just posted.
I have a Bing key code and have it entered.
I'm finding that the "Plot Geocoder" field is set to disabled and one cannot select Bing Maps, because it flips back to disabled.

[I still need to play with it more. If there is a video or something about its use, it would help (even if for the old version).]
Gary Gauthier
Hunting History in the Wild!
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

The Bing API Key must be exactly 108 characters long to enable the Bing Maps options.
I've assumed that all Bing API Key codes are that length, but maybe that is not the case.
How long is your API Key?

You will have to widen the plugin's main window so that the Bing Maps Key: box is wider to see the whole code.

The Help & Advice buttons on each tab open the advice for the published Version 5.2 which is mostly still relevant.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Gary_G
Megastar
Posts: 721
Joined: 24 Mar 2023 19:05
Family Historian: V7

Re: Map Life Facts plugin with Bing Maps support

Post by Gary_G »

Mike;

My key is only 64 characters.
Gary Gauthier
Hunting History in the Wild!
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

tatewise wrote: 11 Apr 2023 15:52 If either API Key is not entered then the associated Google Maps or Bing Maps options will not be accepted.
When the plugin is first run by a new user a popup message explains about entering those API Keys.
Mike,

I plan to keep geocoding using Google maps. If I only want to use Bing maps to display the results, is a Bing API key still needed? I wasn't sure so thought I'd ask before creating one.

Thanks,
Bill
Bill Henshaw
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

Bill, yes, a Bing API Key is needed for any Bing Maps feature.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

tatewise wrote: 11 Apr 2023 20:52 Bill, yes, a Bing API Key is needed for any Bing Maps feature.
Thanks.

My key is 108 characters. I chose Windows application for the type of key. Is that the right option to chose?

Maybe the key is a different length if a different option is chosen????

Bill
Bill Henshaw
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

Gary, my Bing Maps API Key is spread over several lines as shown below, but the Copy key button on the right ensures it all gets copied so that paste into the plugin includes the entire key. Is yours really only 64 characters long?

If Bing Maps API Keys can be of very variable length then the plugin can only check if they exceed say 60 characters.
If the key is invalid then the geocoder and the map display will misbehave.

BingMapsAPIKey.png
BingMapsAPIKey.png (25.79 KiB) Viewed 3683 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

I set the Plot Geocoder to Google Maps. I then set the plugin map pane to Bing Maps and immediately got this error.

image1.jpg
image1.jpg (17.9 KiB) Viewed 3680 times

Bill
Bill Henshaw
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

I closed the plugin and reopened it and got the same error. I tried this a couple time and then it seemed to work fine. I was able to set the option to Bing Maps and all worked well. I tried plotting a couple places on the Bing map that were were already geocoded. That seemed to work fine and then I got this.

image2.jpg
image2.jpg (18.47 KiB) Viewed 3675 times

Bill
Bill Henshaw
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

Thanks for the feedback Bill.
Those errors are not like any that I've experienced during testing, except for genuine coding faults.
The first one is the JavaScript file that the plugin creates to display maps. Since it involves Bing Maps it is full of references to Microsoft.Maps so perhaps the script needs a delay built in to allow things to settle.
The second one is the JavaScript downloaded from https://www.bing.com/api/maps/mapcontrol and may be a side effect of the above problem.

Your Bing Maps API Key must be exactly 108 characters long otherwise the plugin would not let you choose Bing Maps.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

At the moment I have set the plugin back to Leaflet maps. I can test Bing again when you come out with an updated version.

Bill
Bill Henshaw
avatar
Gary_G
Megastar
Posts: 721
Joined: 24 Mar 2023 19:05
Family Historian: V7

Re: Map Life Facts plugin with Bing Maps support

Post by Gary_G »

Mike;

Odd about the key length. Mine is definitely 64 characters, no more, no less.

I think there's a piece missing in the instructions for obtaining a key.

You have, "Key type: Basic / Windows Application".
I have, "Key type: Basic / Dev/Test".

I set mine to the type you have and it came back with the longer key.
Gary Gauthier
Hunting History in the Wild!
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

Good point. I had overlooked that Create Key form that needs the following settings:
Application Name: Map Life Facts
Key Type: Basic (no alternative)
Application Type: Windows Application

https://www.microsoft.com/en-us/maps/cr ... g-maps-key under Business and Personal Use halfway down the page says:
Windows App allows "Public and private Windows App, Education and Non-profit: Maximum 50,000 cumulative billable transactions within any 24-hour period." which should be enough for anyone.

Attached is an improved Map Life Facts plugin which fixes a Geocode Plotting bug, remembers the Bing Maps type chosen from the drop list for Road, Aerial, Birds Eye (which can be slow), or Ordinance Survey, and adds some delays that may help with Bill's problem.
Last edited by tatewise on 20 Apr 2023 16:00, edited 1 time in total.
Reason: Attachment deleted as better version is attached later.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

I Installed version 5.2.2, started the plugin, set it to Bing Maps and got this.

image3.jpg
image3.jpg (17.15 KiB) Viewed 3643 times

Bill
Bill Henshaw
avatar
Gary_G
Megastar
Posts: 721
Joined: 24 Mar 2023 19:05
Family Historian: V7

Re: Map Life Facts plugin with Bing Maps support

Post by Gary_G »

Mike;

Is there a typical use-case write-up of even the old plug-in? If not, perhaps a video was made?
While I always do backups, I just want to make sure I don't something silly in trying it the first few times.
Gary Gauthier
Hunting History in the Wild!
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

I just noticed that I also got this and the map doesn't even show on the Geocode Location Plots tab.

image4.jpg
image4.jpg (61.43 KiB) Viewed 3648 times

Bill
Bill Henshaw
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

Bill, once there is a script error then usually Map Action Sync Failed occurs and no map displayed. The plugin must be closed and run again. It looks like my extra delays have not helped but I don't yet understand the cause of the problem.
Having chosen Bing Maps on the Web Page Map Options tab, how did you get to the Geocode Location Plots tab?

Gary, you asked that before and I replied:
The Help & Advice buttons on each tab open the advice for the published Version 5.2 which is mostly still relevant.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Gary_G
Megastar
Posts: 721
Joined: 24 Mar 2023 19:05
Family Historian: V7

Re: Map Life Facts plugin with Bing Maps support

Post by Gary_G »

Sorry Mike. There's a lot going on here and I dropped the ball.
It's good that the old examples are still mostly valid. Thanks.
Gary Gauthier
Hunting History in the Wild!
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

tatewise wrote: 11 Apr 2023 23:51 Having chosen Bing Maps on the Web Page Map Options tab, how did you get to the Geocode Location Plots tab?
I just clicked on the Geocode Location Plots tab.

Bill
Bill Henshaw
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

I've reread the Bing Maps API Documentation and made some JavaScript changes that may fix Bill's problem (I hope).
I've also fixed the Geocode Plotting which had a silly typo that stopped it from working.
There are still some display issues with zooming and centring single plots with Bing Maps, but I thought it worth offering this updated version for you to try.
Last edited by tatewise on 20 Apr 2023 16:01, edited 1 time in total.
Reason: Attachment deleted as better version is attached later.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

Well... a little different with this version. I ran the plugin with Plugin Map Pane still set to Leaflet Maps. Then I switched the setting to Bing Maps and I got the Map Action Sync Failed error and no map appeared. I did not get a script error as I did in the last version.

I closed the plugin and ran it again with the setting still set to Bing Maps and I got this script error.

image5.jpg
image5.jpg (19.13 KiB) Viewed 3555 times

Bill
Bill Henshaw
User avatar
BillH
Megastar
Posts: 2258
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Map Life Facts plugin with Bing Maps support

Post by BillH »

Mike,

Just to let you know. I had clicked on "No" when I got the last script error and closed the plugin. I just tried again and go the same script error. I clicked on "Yes" and then the Status changed to OK and the map appeared. It seems to be working fine (at least for now).

Edit: 15 minutes later I tried running the plugin and again get the Map Action Sync Failed error with no map appearing. No script error.

Bill
Bill Henshaw
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

The Microsoft error in my JavaScript has been cured as I expected from the changes I made.
However, something is still upsetting the script downloaded from www.bing.com/api/maps before it even gets started.
I'll have to investigate further.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Map Life Facts plugin with Bing Maps support

Post by tatewise »

Bill can you check that in any browser if you visit https://www.bing.com/api/maps/mapcontrol that it reliably displays a lot of JavaScript text starting with:

(function () {
for(var namespacePart,internalNamespace,namespaceParts=["Microsoft","Maps"],mapsNamespace=window,i=0;

Similarly, check that https://sdk.virtualearth.net/maps/sdkrelease/mapcontrol works the same way.

Also, try running the plugin from the Family Historian Sample Project please.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply