03-08-2011 06:33 AM - edited 03-09-2011 12:35 AM
Hi all,
How can I show dynamic map in my webworks aplicatiobn for BlackBerry? I have tried different ways to acomplish that and nowreached nowhere.
Tried:
#1: Google Maps JavaScript API V2
Eg:
var map = new GMap2(document.getElementById("map_canvas"));
Error: GMap2 is undefined
#2: Tried navigator.geolocation.
Eg:
navigator.geolocation.getCurrentPosition(geolocati
Problem: Never executes the events geolocationSuccess and geolocationError
Please put your thoughts and help me.
-anu
03-08-2011 07:59 AM
For a tutorial on how to use Geolocation you can check out the following link:
Can you also post up the OS version number you are attempting to use? For dynamic mapping can you explain the features you would like to use?
03-09-2011 01:37 AM
Hello,
Thank you very much for your time to look into this.
I have followed same steps in the tutorial and I found the events "geolocationSuccess" and "geolocationError" never fires, event though the line
navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError, options);
executes fine.
Here I am pasting my relevant code:
function locationUpdated() {
if (navigator.geolocation !== null) {
var options;
alert("navigator.geolocation.getCurrentPosition executing");
navigator.geolocation.getCurrentPosition(geolocati onSuccess, geolocationError, options);
alert(navigator.geolocation); // Got Object
}
else {
alert("HTML5 geolocation is not supported.");
}
}
function geolocationSuccess(position) {
alert("Inside Success"); // Not getting alert even after waiting long time
}
function geolocationError(error) {
alert("An unexpected error occurred [" + error.code + "]: " + error.message); // Not getting alert even after waiting long time
}
I am having script references as shown below on page:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="Scripts/html5_init.js" id="html5_init"></script>
Tried adding Permission for domains in config.xml
- added http://code.google.com
- added http://maps.google.com
- allowed almost every features for these domains and localhost.
- Set the GPS location in simulator also
I am stuck now that "why the events not firing" ?
I am using BlackBerry 9550 Simulator.
I need dynamic map and street view in my webworks application.
-anu