documenting /src/viewer/map.js

0 views
Skip to first unread message

agent marmorkuchen

unread,
Mar 22, 2009, 8:20:55 PM3/22/09
to groundcrew-vie...@googlegroups.com
hello over there...

looking at /src/viewer/map.js today:

- variable map: presumably there is a reason why it is not inside the Map
namespace, eh? it seems to be the same as Map.GMap anyway...

- i suggest to define the variable initted in the beginning of the Map,
because it is used in a kind of 'static' context where it's state is
kept and important for later calls to the function it is used in. and
probably it will be used from outside of Map one day, so it's usage
won't be local to the function anymore.
i also suggest to rename it to 'initialized' for proper english.

bye,
marmorkuchen
--
_ ascii ribbon campaign .oOo. GCSd-s:+aC++ULB+++W++M+PS+++Y+
( )
X Ich bin nicht jung genug um alles zu wissen.
/ \

Joe Edelman

unread,
Mar 23, 2009, 10:45:59 AM3/23/09
to groundcrew-vie...@googlegroups.com
>- variable map: presumably there is a reason why it is not inside the Map
> namespace, eh? it seems to be the same as Map.GMap anyway...

Ignore this. It's there because there are certain google maps layers
that expect to find it there. But the official name is Map.Gmap, and
that's what should be used throughout the code. Just pretend the
lower-case 'map' global isn't there..

>- i suggest to define the variable initted in the beginning of the Map,
> because it is used in a kind of 'static' context where it's state is
> kept and important for later calls to the function it is used in. and
> probably it will be used from outside of Map one day, so it's usage
> won't be local to the function anymore.
> i also suggest to rename it to 'initialized' for proper english.

Good idea, I agree completely about this convention for static
variables. Go for it.

--Joe

agent marmorkuchen

unread,
Mar 23, 2009, 3:41:41 PM3/23/09
to groundcrew-vie...@googlegroups.com
hoi...

* Joe Edelman <joe.e...@gmail.com> [2009-03-23 11:15 -0400]:


>
> >- variable map: presumably there is a reason why it is not inside the Map
> > namespace, eh? it seems to be the same as Map.GMap anyway...
>
> Ignore this. It's there because there are certain google maps layers
> that expect to find it there. But the official name is Map.Gmap, and
> that's what should be used throughout the code. Just pretend the
> lower-case 'map' global isn't there..

k.


> >- i suggest to define the variable initted in the beginning of the Map,
> > because it is used in a kind of 'static' context where it's state is
> > kept and important for later calls to the function it is used in. and
> > probably it will be used from outside of Map one day, so it's usage
> > won't be local to the function anymore.
> > i also suggest to rename it to 'initialized' for proper english.
>
> Good idea, I agree completely about this convention for static
> variables. Go for it.

http://github.com/marmorkuchen/groundcrew-viewer/commit/4a45b139a8c3a183c17598ce4fc17a1df028ef08

Reply all
Reply to author
Forward
0 new messages