Monday, 9 September 2013

The map of Google Maps are not showing but the controls do

The map of Google Maps are not showing but the controls do

I'm fetching the coordinates from the URL that looks like this (part of it
of course): weather/59.328676,13.485656. Now, I have extract these
coordinates using a function. When I am trying to load Google Maps, the
controls shows but not the actual map. You can see what I mean by clicking
on this link:
http://server-1.myftp.org/vadret-just.nu/weather/59.328676,13.485656. The
code I'm using are this:
function url_endstring(url){
return url.substr(url.lastIndexOf('/') + 1);
}
var coordinates = url_endstring(window.location.href);
var latlng = new google.maps.LatLng(coordinates);
var map_options;
var gm_map;
var marker;
function initialize() {
latlng;
map_options = {
center: latlng,
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
}
};
gm_map = new google.maps.Map(document.getElementById('google-maps'),
map_options);
marker = new google.maps.Marker({
position: latlng,
map: gm_map
});
}
Have I missed something? How can I make the Google Maps map visible?

No comments:

Post a Comment