Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp form stuck - Virtualearth to Bing Maps form stalls on Navigate

Status
Not open for further replies.

wbstrider

Programmer
Mar 2, 2001
78
0
0
US
I previously used Craig Boyd's excellent class/vcx from Southwest Fox. It was version 6.x
Now to convert this I am hoping someone can give skeletal flow chart so I can make progress. Currently the html file runs Bing Maps when opened in Firefox. However, the html/Javascript won't run from the Ole form Navigate without saying scripting error.
I am aware many are choosing Google Maps over Bing Maps. Would like to use Bing if possible. I run this small company with VFP. Still running Mappoint and routing everything using VFP form with pushpins.
Just stuck. Thanks for any suggestion that ends with.. Yes I can do it with VFP form. :eek:)

One Code to rule them all, One code to bind them.
 
I previously used Craig Boyd's excellent class/vcx from Southwest Fox.

Could you tell us which class you are referring to. Craig Boyd has published very many classes over the years, many of which could be described as excellent and many of which were presented at SW Fox. A link to the class in question would help us figure out which one you need help with.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Apologies for not using the correct references. (even though my career has been with VFP, I'm no expert)
Craig's VirtualEarth demo at SW fox used one html file like;
<script type="text/javascript" src="Then below that having functions .. calling GetMap or LoadMap.
The new Bing uses
src=" async defer
then inside the GetMap
map = new Microsoft.Maps.Map(document.getElementById('myMap'),Credentials,options...)

THE Navigate method points to the html file and when it runs on Win7 it errors out on the src=" line. WinXP virtual machine will fly past it without an error, however no map appears in the OLe control.
If I open the html file thru Firefox... the map instantly appears.
So, maybe I should try to do this differently?

Just figured I'd ask before heading down the wrong path. Thanks

One Code to rule them all, One code to bind them.
 
You don't have a bing problem; you have a problem opening an HTML file within the Web browser Control. When loading HTML via file link Javascript content is blocked.
Besides that your HTML works, it just needs your own MS account bing credentials.

Bye, Olaf.
 
Olaf, your help on this site has been an inspiration for many years.
I have the credentials. I removed them when I posted it. (as I mentioned the File opens and the map appears when ran inside browser)
If the javascript is blocked, we always have found a work around in the past to be able to perform any task via VFP. I will certainly do the research if pointed in the right direction.
I would like to run the Bing code.. show the map, create pushpins, etc. Just like I do now with mappoint directly from my VFP form. Routing, Arranging everything without my users having to exit VFP. It's awesome... just now we need to use Bing since maps are old.
As posted by Mike Gagnon on Foxite, Google Maps easily opens from a form. If I need to use Google Maps...I will.
Just hoped someone would know a way to use Bing. Since all my code works for Mappoint and converting that would be sweet.
Thanks

One Code to rule them all, One code to bind them.
 
I haven't been at SWFox, I don't have the session, but I'm sure it's all in there, including the json.js.

You normally put web on the web, you always have restrictions, when using files to open. Setup a localhost at least and you'll get around the JS blocking. Always has been that way, and that is generally so, not specifically with bing. I really meant you don't have a bing problem, when I said so.

To demo:
Code:
<html><script>alert('Hello, World');</script></html>

Save that as html, you might add a better html skeleton, etc., doesn't matter. If you double click on the HTML file or use a webbrowser control and navigate to that file.

If that's not your problem, you should perhaps tell what error you get in Windows 7, because I don't get an error in Windows 10, other than the blocking JS I can override or simply set the browser to accept JS from local content, too.

Aside of the missing json.js, I don't get an error, so I can't help you otherwise than pointing out you may just need to dig deeper into the session material of Craig.

Bye, Olaf.
 
Ok, I have no errors for scripting and a map.
Mike Gagnon on Foxite, was able to remind me that I needed to put my json, html etc in the project and compile the EXE. Running it thru an EXE bypasses the errors.
So now I can begin the code updating and hopefully be good.
Thank You for your assistance.

One Code to rule them all, One code to bind them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top