Why?

38 views
Skip to first unread message

Abhishek Bhattacharya

unread,
Jun 20, 2011, 2:00:11 PM6/20/11
to google-map...@googlegroups.com
This's my very first code for the "Hello World of Google Maps" tutorial.

I've been trying to find errors in this since a long time, but have failed; and am stuck at the very first stage just due to this.

Can anyone make out the fault.

I guess, the fault's in the "function initialize()".


Thanks,

Abhishek

geoco...@gmail.com

unread,
Jun 20, 2011, 3:38:49 PM6/20/11
to Google Maps JavaScript API v3
On Jun 20, 11:00 am, Abhishek Bhattacharya <abhi.intel...@gmail.com>
wrote:
> This's my very first code for the "Hello World of Google Maps" tutorial.

I would suggest reading this (from the v2 posting guidelines, but...):
http://www.catb.org/~esr/faqs/smart-questions.html#bespecific

>
> I've been trying to find errors in this since a long time, but have failed;
> and am stuck at the very first stage just due to this.
>
> Can anyone make out the fault.

You should be able to use the "Error Console" to see errors.

>
> I guess, the fault's in the "function initialize()".

If you posted a link rather than code, we could do that as well, then
no one would have to guess.

-- Larry

>
> http://goo.gl/KCjCG
>
> Thanks,
>
> Abhishek

Abhishek Bhattacharya

unread,
Jun 21, 2011, 2:26:11 PM6/21/11
to google-map...@googlegroups.com
Sir,

I actually wasn't able to understand your reply to my problem.

Could you please help me?

I hope you'd be understanding that I'm stuck in the very first "Hello world of Google Maps".

Thanks,

Abhishek

Barry Hunter

unread,
Jun 21, 2011, 2:51:30 PM6/21/11
to google-map...@googlegroups.com
You havent specified *exectly* what issue you having. Is the map not
displaying? are you getting a message, is the map coming out green? We
dont know what issue you having.

You havent included a link you *your* webpage. Not a paste of code, a
real live page. A link. We want to view the page in a real browser.

> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/2jR4gGrH9XkJ.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-js-a...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

Michael Geary

unread,
Jun 21, 2011, 3:03:35 PM6/21/11
to google-map...@googlegroups.com
As Barry and Larry said, it would be best to post a link to an actual map page that we can load in the browser.

But since you posted your code... Have you compared it *carefully* with the original code on this page:


Use a "diff" or "compare" program to make it easier to see what you changed, or just read the code *carefully*.

Do you see what you removed or left out from the original code? There is something important missing in your code.

-Mike


Thanks,

Abhishek

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Abhishek Bhattacharya

unread,
Jun 22, 2011, 2:38:31 AM6/22/11
to google-map...@googlegroups.com
Thanks a lot, Mike.

I was unaware of the "diff" and "cmp"!

But, one question,
after we've defined the "LatLng" coordinates, there's a "semi-colon" in the original code, but, it works without the code.

Am I right toward this? If yes, why is it then given in the original code?
Thanks,

Abhishek

Barry Hunter

unread,
Jun 22, 2011, 10:14:35 AM6/22/11
to google-map...@googlegroups.com
On Wed, Jun 22, 2011 at 7:38 AM, Abhishek Bhattacharya
<abhi.i...@gmail.com> wrote:
> Thanks a lot, Mike.
> I was unaware of the "diff" and "cmp"!
> But, one question,
> after we've defined the "LatLng" coordinates, there's a "semi-colon" in the
> original code, but, it works without the code.

Not really a maps question, but general javascript syntax

http://www.howtocreate.co.uk/tutorials/javascript/semicolons

>
> Am I right toward this? If yes, why is it then given in the original code?
> Thanks,
>
> Abhishek
>

> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/google-maps-js-api-v3/-/1TqW-KoCjiMJ.

en4ce

unread,
Jun 22, 2011, 11:16:34 AM6/22/11
to Google Maps JavaScript API v3
And these are examples of where you should not put a semicolon:

if( x < 5 ) {
x++;
};

this is correct but just by the way

On 22 Jun., 16:14, Barry Hunter <barrybhun...@gmail.com> wrote:
> On Wed, Jun 22, 2011 at 7:38 AM, Abhishek Bhattacharya
>

Michael Geary

unread,
Jun 22, 2011, 3:54:19 PM6/22/11
to google-map...@googlegroups.com
Barry pointed you toward information about the semicolons, which are a matter of JavaScript syntax not directly related to the Maps API. As you get more familiar with JavaScript, this stuff will get easier.

But the difference I noticed was something else - in the code you posted, I didn't see anywhere that the initialize() function ever gets called. In the original example, this is done in an onload handler in the body tag - which doesn't appear in your version.

-Mike

Thanks,

Abhishek

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Abhishek Bhattacharya

unread,
Jun 25, 2011, 6:39:29 AM6/25/11
to google-map...@googlegroups.com
Yeah,
Actually I had out here an old version of my code.
I had then added a "<body onload>" event handler.

Later, it started working by using the "cmp" service as suggested by you.

But, my questions about the semicolon was a different thing.

Abhishek
Reply all
Reply to author
Forward
0 new messages