But I got a blank page as a result (in another word, the map is not loaded, just the Google label and the zoom in/ zoom out buttons), although I tested them using this web site:
http://www.coordonnees-gps.fr/
And this is the code source of the map:
<script>
var map, placesList;
var lat,lon;
function initialize(lat, lon) {
var pyrmont = new google.maps.LatLng(lat, lon);
map = new google.maps.Map(document.getElementById('map-canvas'), {
center : pyrmont,
zoom : 17
});
var request = {
location : pyrmont,
radius : 500,
types : [ 'bank' ]
};
placesList = document.getElementById('places');
var service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);
}
function callback(results, status, pagination) {
if (status != google.maps.places.PlacesServiceStatus.OK) {
return;
} else {
createMarkers(results);
if (pagination.hasNextPage) {
var moreButton = document.getElementById('more');
moreButton.disabled = false;
google.maps.event.addDomListenerOnce(moreButton, 'click',
function() {
moreButton.disabled = true;
pagination.nextPage();
});
}
}
}
function createMarkers(places) {
var bounds = new google.maps.LatLngBounds();
for (var i = 0, place; place = places[i]; i++) {
var image = {
url : place.icon,
size : new google.maps.Size(71, 71),
origin : new google.maps.Point(0, 0),
anchor : new google.maps.Point(17, 34),
scaledSize : new google.maps.Size(25, 25)
};
var marker = new google.maps.Marker({
map : map,
icon : image,
title : place.name,
position : place.geometry.location
});
//placesList.innerHTML += '<li>' + place.name + '</li>';
bounds.extend(place.geometry.location);
}
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
Problem with the map coordinates using the RD-PQ device
Hi,
I am developping a Tizen web app, I have this code:
function showLocation(location) { console.log('latitude: ' + location.coords.latitude + ' longitude: ' + location.coords.longitude); lat=location.coords.latitude; lon=location.coords.longitude; }The problem is that I got these coordantes into the IDE console:
But I got a blank page as a result (in another word, the map is not loaded, just the Google label and the zoom in/ zoom out buttons), although I tested them using this web site:
http://www.coordonnees-gps.fr/
And this is the code source of the map:
<script> var map, placesList; var lat,lon; function initialize(lat, lon) { var pyrmont = new google.maps.LatLng(lat, lon); map = new google.maps.Map(document.getElementById('map-canvas'), { center : pyrmont, zoom : 17 }); var request = { location : pyrmont, radius : 500, types : [ 'bank' ] }; placesList = document.getElementById('places'); var service = new google.maps.places.PlacesService(map); service.nearbySearch(request, callback); } function callback(results, status, pagination) { if (status != google.maps.places.PlacesServiceStatus.OK) { return; } else { createMarkers(results); if (pagination.hasNextPage) { var moreButton = document.getElementById('more'); moreButton.disabled = false; google.maps.event.addDomListenerOnce(moreButton, 'click', function() { moreButton.disabled = true; pagination.nextPage(); }); } } } function createMarkers(places) { var bounds = new google.maps.LatLngBounds(); for (var i = 0, place; place = places[i]; i++) { var image = { url : place.icon, size : new google.maps.Size(71, 71), origin : new google.maps.Point(0, 0), anchor : new google.maps.Point(17, 34), scaledSize : new google.maps.Size(25, 25) }; var marker = new google.maps.Marker({ map : map, icon : image, title : place.name, position : place.geometry.location }); //placesList.innerHTML += '<li>' + place.name + '</li>'; bounds.extend(place.geometry.location); } map.fitBounds(bounds); } google.maps.event.addDomListener(window, 'load', initialize); </script>What’s is the problem?
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio