Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 41
Registered: ‎05-03-2012
My Device: Blackberry 10 Alpha, Blackberry Bold 9930
My Carrier: Fido

webworks bing geolocation

Hey guys, 

I seem to be having an issue involving bing maps; I need to be able to zoom into the user's location, but when I create the map, all it does is hold steady at the world view.

 

The code currently looks like this:

 

function getPosition()
{   
    if (navigator.geolocation !== null)
	{
		map = new Microsoft.Maps.Map(document.getElementById("map"), {credentials:bing_api, mayTypeId: Microsoft.Maps.MapTypeId.road});
        var geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map);
        geoLocationProvider.getCurrentPosition({successCallback:
            function(object)
            {
                alert("SUCCCESS CURRENT POSITION IS:" + object.center);
            }
        });
	} 
	else 
    {
		errorMessage("Geolocation is not supported.");
	}
} 

 The alert was just to see if my geoLocationProvider is successful; it's not returning anything. Also, the map type is set to automatic, even though I've set it here as "road".

 

Any ideas/solutions as to what's going on?

 

Thanks.

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: webworks bing geolocation

Have you tried just getting a location fix? Do you know if the device is getting a GPS location?

 

Which device is this on? What about Carrier, OS Version, etc?

Tim Windsor
Open Source Technical Lead
Contributor
Posts: 41
Registered: ‎05-03-2012
My Device: Blackberry 10 Alpha, Blackberry Bold 9930
My Carrier: Fido

Re: webworks bing geolocation

I've tried getting a location fix, nothing happens. Only works if I hard-code the location (which defeats the purpose of geolocation).

 

I'm currently developing on BB10, using both the Ripple emulator and the standalone BB10 Dev Alpha simulator

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: webworks bing geolocation

Neither the emulator or the simulator have actual GPS capabilities. Ripple should be able to mimic a GPS location. I just tested it with the KitchenSink application and it was able to get an emulated fix. Maybe start there.

Tim Windsor
Open Source Technical Lead