Welcome Guest | Login

Google Maps not working

Hi
A small google maps app I have written works on my development machine (WEBrick) but fails on HostingRails. The Google map box is displayed but there is no map.

I have tried the Hello World example code in both environments with the same results.

var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);

Note,I have setup and use a different API key for each environment. The keys are correct since I dont get a key error in either environment.

I was wondering if anyone knows of any possible reasons why I might get this behaviour on HostingRails (or a shared host)

Rhubarb

2007-08-07 03:30 AM

I have a Google map app on our shared servers and haven't noticed such problems.  Feel free to share the URL or open a support ticket on this one so we can take a look. You should be able to look at the source code that is generated to figure out the problem, as its all javascript.  

2007-08-07 05:12 AM

I solved it. I removed the options and now it works also on HostingRails. I dont know why there should be a difference when running locally and shared since I am on the same browser where the Javascript is happening. I also dont know what is going on with the options. They dont seem to be documented (well)

//gmap = new GMap2(document.getElementById(map),[G_SATELLITE_MAP,G_NORMAL_MAP,G_HYBRID_MAP]); // does not work

 gmap = new GMap2(document.getElementById(map));           // works

Rhubarb

2007-08-12 03:10 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.