Ran into this strange issue recently. I'm more of a web programmer and I've only just ventured into developing apps. I've been trying to develop this mapping app on windows phone 8.1 using HTML and I came across a problem.
When I try to integrate Bing maps, I'm supposed to add the URL at virtualearth to my HTML page as a script.
Now, when I try to initialize my map using
if (Microsoft.Maps.ClientRegion) {
Microsoft.Maps.loadModule('Microsoft.Maps.Map', { callback: getMap });
} else {
getMap();
}
Visual Studio breaks the execution and tells me that 'Microsoft' is undefined. It doesn't make sense since this code works perfectly in a browser. I tried linking to another script file on my server and called a random function to display "hello world" and it worked. So, That clearly implies that the app has no problem referring to external scripts.
I gave up on Bing and tried to deploy Google maps in my app. Same thing except now it says, "google" is undefined.
I have no idea what's happening here. Any sort of help is appreciated! Fyi, I've also called init() once the document loads.
Thanks in advance!
Edit: To be clear, this isn't a web app running through a browser. There is an option for me to code in HTML in Visual Studio and it worked fine until this showed up. I've also partly developed a Windows 8 Desktop app using HTML and using Bing Maps to integrate mapping functionalities and it works great.
What I don't understand is how the code for the mobile app works great through a browser, works great on windows store apps, but doesn't work at all when coded directly through Visual Studio. I am pretty sure I've missed something. I hope someone can figure this out.
When I try to integrate Bing maps, I'm supposed to add the URL at virtualearth to my HTML page as a script.
Now, when I try to initialize my map using
if (Microsoft.Maps.ClientRegion) {
Microsoft.Maps.loadModule('Microsoft.Maps.Map', { callback: getMap });
} else {
getMap();
}
Visual Studio breaks the execution and tells me that 'Microsoft' is undefined. It doesn't make sense since this code works perfectly in a browser. I tried linking to another script file on my server and called a random function to display "hello world" and it worked. So, That clearly implies that the app has no problem referring to external scripts.
I gave up on Bing and tried to deploy Google maps in my app. Same thing except now it says, "google" is undefined.
I have no idea what's happening here. Any sort of help is appreciated! Fyi, I've also called init() once the document loads.
Thanks in advance!
Edit: To be clear, this isn't a web app running through a browser. There is an option for me to code in HTML in Visual Studio and it worked fine until this showed up. I've also partly developed a Windows 8 Desktop app using HTML and using Bing Maps to integrate mapping functionalities and it works great.
What I don't understand is how the code for the mobile app works great through a browser, works great on windows store apps, but doesn't work at all when coded directly through Visual Studio. I am pretty sure I've missed something. I hope someone can figure this out.