Advice please - Custom map for a flat game world

2,631 views
Skip to first unread message

evilC

unread,
Jan 25, 2010, 5:15:05 PM1/25/10
to Google Maps JavaScript API v3
I have a reasonable amount of experience with the Google Maps API, but
none so far with custom map types and I have been asked to help to
make a map of an online game world ( http://navemap.com ).

Now from my research, it seems that the smart move would be to
properly integrate the game's coordinate system into the map so that
things are all accurate. AFAIK, the game world is in effect flat. I am
not yet sure on wrapping, there may be e/w wrapping (So it may in
effect be a cylinder). I think the origin is in the centre of the map,
with negative values for west and north of the origin.

So from reading the API documentation, it seems to me that I do not
want to use a projection? Or if the map insists on one, a plain 1:1
conversion from world coordinates to map coordinates?

Either that, or will it work properly if I just map game world
coordinates to lat and lng? I am worried about the effects of the
mercator projection on a world which is not spherical.

Please advise.

Ben Appleton

unread,
Jan 25, 2010, 6:08:09 PM1/25/10
to google-map...@googlegroups.com
On Tue, Jan 26, 2010 at 9:15 AM, evilC <ev...@evilc.com> wrote:
I have a reasonable amount of experience with the Google Maps API, but
none so far with custom map types and I have been asked to help to
make a map of an online game world ( http://navemap.com ).

Now from my research, it seems that the smart move would be to
properly integrate the game's coordinate system into the map so that
things are all accurate. AFAIK, the game world is in effect flat. I am
not yet sure on wrapping, there may be e/w wrapping (So it may in
effect be a cylinder). I think the origin is in the centre of the map,
with negative values for west and north of the origin.

OK.  The Maps API uses latitude/longitude coordinates, which are cylindrical.  That is, there is e/w wrapping but no n/s wrapping.  If your game coordinates do not wrap e/w, then you can either:
1 - Avoid the +/- 180 longitude line by placing your game map from -90 to +90 longitude.  No-one is likely to pan so far offscreen that they notice the world wraps.
2 - Or, listen for Map event "center_changed" and if the map pans outside -90 to +90 longitude just setCenter() to the nearest point back inside these bounds.

So from reading the API documentation, it seems to me that I do not
want to use a projection? Or if the map insists on one, a plain 1:1
conversion from world coordinates to map coordinates?

Yes, a plain 1:1 conversion would do.  So I suggest using ImageMapType to download your map tiles, and attach a .projection object like:

var myMapType = new ImageMapType(...);

var myProjection = {};
myProjection.fromLatLngToPoint = function(latLng) {
  return new Point(latLng.lng(), latLng.lat());
};
myProjection.fromPointToLatLng = function(point) {
  return new LatLng(point.y, point.x);
};

// Set the projection for custom map type:
myMapType.projection = new MyProjection;

Now this is a bit oversimplified: you'll have to tweak the projection so that eg. markers are placed in the right positions on your tiles, otherwise all your overlays will be misaligned.
 
Either that, or will it work properly if I just map game world
coordinates to lat and lng? I am worried about the effects of the
mercator projection on a world which is not spherical.

Please advise.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
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.


evilC

unread,
Jan 26, 2010, 5:02:07 PM1/26/10
to Google Maps JavaScript API v3
Thanks Ben.

Whilst mapping game coordinates to lats and lngs sounds like a simple
option, it doesn't seem the "right" way to me.

Lats and Lngs are surely angles, whereas the game world coordinates
are distance-based. If I were to shoehorn game coords into a latlng
system, and then they expand the game world, I have to re-shrink the
world to fit in the latlng system again.

Is there a way to do away with lats and lngs altogether, or at least
change the numbering system so that it is not angle based or the
number scale is different? Ideally I would like to modify the API to
use actual world coordinates, rather than some ghastly bodge.


> Now this is a bit oversimplified: you'll have to tweak the projection so
> that eg. markers are placed in the right positions on your tiles, otherwise
> all your overlays will be misaligned.

By this do you mean the raising to the power of two for each zoom
level for tile coordinates (I saw something about that in the
documentation).

Regards

Clive

Ben Appleton

unread,
Jan 26, 2010, 6:12:24 PM1/26/10
to google-map...@googlegroups.com
On Wed, Jan 27, 2010 at 9:02 AM, evilC <ev...@evilc.com> wrote:
Thanks Ben.

Whilst mapping game coordinates to lats and lngs sounds like a simple
option, it doesn't seem the "right" way to me.

Lats and Lngs are surely angles, whereas the game world coordinates
are distance-based. If I were to shoehorn game coords into a latlng
system, and then they expand the game world, I have to re-shrink the
world to fit in the latlng system again.

Is there a way to do away with lats and lngs altogether, or at least
change the numbering system so that it is not angle based or the
number scale is different? Ideally I would like to modify the API to
use actual world coordinates, rather than some ghastly bodge.

No; the public interfaces all use latitude/longitude.

> Now this is a bit oversimplified: you'll have to tweak the projection so
> that eg. markers are placed in the right positions on your tiles, otherwise
> all your overlays will be misaligned.

By this do you mean the raising to the power of two for each zoom
level for tile coordinates (I saw something about that in the
documentation).

No, the v3 API handles zooming itself.  But even at zoom 0 you'll need to write your JS Projection implementation to match the projection used in your tile server.
 
Regards

Clive

evilC

unread,
Jan 26, 2010, 9:43:19 PM1/26/10
to Google Maps JavaScript API v3
Hmm, I am still left unsure what you mean by this then

> Now this is a bit oversimplified: you'll have to tweak the projection so
> that eg. markers are placed in the right positions on your tiles, otherwise
> all your overlays will be misaligned.

Why would markers not appear in the right place?

TIA

Clive

Ben Appleton

unread,
Jan 26, 2010, 10:08:48 PM1/26/10
to google-map...@googlegroups.com
Your tile server has projected features from game coordinates to pixel coordinates.  If you need to overlay a marker in the browser such that it lines up with features rendered in your tiles, you'll need to ensure that you place that marker at the right pixel coordinates.
 
TIA

evilC

unread,
Jan 27, 2010, 8:31:34 AM1/27/10
to Google Maps JavaScript API v3
Oh, the custom projection does not handle this? I thought that was
part of the point of the custom projection's fromLatLngToPoint
function?

This is all starting to sound a bit more complex than I had imagined,
and it seems to be the kind of thing that if you got it wrong, you
possibly wouldn't realise until you got a bunch of data in there...

I don't suppose there is any chance that somebody could whip up a
working example? The scales used could be arbitrary, I am sure I could
tweak an example to fit various coordinate systems, if only I had a
flat world example to build from.

Cheers

Clive

> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2Bunsu...@googlegroups.com>

Ben Appleton

unread,
Jan 27, 2010, 7:22:33 PM1/27/10
to google-map...@googlegroups.com
On Thu, Jan 28, 2010 at 12:31 AM, evilC <ev...@evilc.com> wrote:
Oh, the custom projection does not handle this? I thought that was
part of the point of the custom projection's fromLatLngToPoint
function?

Exactly: all I am saying is that your custom projection has to handle this, by matching your tiles.
 
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

Brak

unread,
Feb 23, 2010, 11:58:57 AM2/23/10
to Google Maps JavaScript API v3
I too am interested in this functionality for my custom maps. I would
love to build a custom projection for my custom maps that is just 1:1,
but I could live with the LatLng system. My only problem with that
system is that, using the mercator projection, the world wraps and I
need to find a way for my polygons, polylines, markers and infoboxes
to not appear in empty space when zoomed out. I'm assuming that a 1:1
could be a solution to this, but all I can do is guess at this point.

I tried fiddling with your example code using it as a basis and I
couldn't get it into a state that Google Maps could make any sense of.
Without any documentation on how the projections are supposed to be
formulated I'm sort of at a loss.

Alternatively, can you think of any way to simply disable tiling and
subsequently drawing the overlays outside of the "home tile" (tile 0,0
at zoom level 0)?. I also have a "Center Map" Control button that is
supposed to center the map, but it's expecting a wrapping world too
and will center on a non-existent adjacent tile if the map is scooted
too far left or right.

evilC: Did you ever get your projection to work? How is your map
system coming along?

On Jan 25, 6:08 pm, Ben Appleton <apple...@google.com> wrote:
> On Tue, Jan 26, 2010 at 9:15 AM, evilC <ev...@evilc.com> wrote:
> > I have a reasonable amount of experience with the Google Maps API, but
> > none so far with custom map types and I have been asked to help to
> > make a map of an online game world (http://navemap.com).
>
> > Now from my research, it seems that the smart move would be to
> > properly integrate the game's coordinate system into the map so that
> > things are all accurate. AFAIK, the game world is in effect flat. I am
> > not yet sure on wrapping, there may be e/w wrapping (So it may in
> > effect be a cylinder). I think the origin is in the centre of the map,
> > with negative values for west and north of the origin.
>
> OK.  The Maps API uses latitude/longitude coordinates, which are
> cylindrical.  That is, there is e/w wrapping but no n/s wrapping.  If your
> game coordinates do not wrap e/w, then you can either:
> 1 - Avoid the +/- 180 longitude line by placing your game map from -90 to
> +90 longitude.  No-one is likely to pan so far offscreen that they notice
> the world wraps.
> 2 - Or, listen for Map event "center_changed" and if the map pans outside
> -90 to +90 longitude just setCenter() to the nearest point back inside these
> bounds.
>
> So from reading the API documentation, it seems to me that I do not
>
> > want to use a projection? Or if the map insists on one, a plain 1:1
> > conversion from world coordinates to map coordinates?
>
> Yes, a plain 1:1 conversion would do.  So I suggest using

> ImageMapType<http://code.google.com/apis/maps/documentation/v3/reference.html#Imag...>


> to
> download your map tiles, and attach a .projection object like:
>
> var myMapType = new ImageMapType(...);
>
> var myProjection = {};
> myProjection.fromLatLngToPoint = function(latLng) {
>   return new Point(latLng.lng(), latLng.lat());};
>
> myProjection.fromPointToLatLng = function(point) {
>   return new LatLng(point.y, point.x);
>
> };
>
> // Set the projection for custom map type:
> myMapType.projection = new MyProjection;
>
> Now this is a bit oversimplified: you'll have to tweak the projection so
> that eg. markers are placed in the right positions on your tiles, otherwise
> all your overlays will be misaligned.
>
>
>
> > Either that, or will it work properly if I just map game world
> > coordinates to lat and lng? I am worried about the effects of the
> > mercator projection on a world which is not spherical.
>
> > Please advise.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > 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<google-maps-js-api-v3%2B­unsub...@googlegroups.com>

Brak

unread,
Mar 9, 2010, 5:17:15 PM3/9/10
to Google Maps JavaScript API v3
After spending a week and a half scratching my head with various
examples I scrapped it and found a new one to work from.
Coincidentally it was written by this board's very own Ben Appleton!

It properly maps the original 256x256 starting tile to top letf:
90,-180 by bottom right: -90,180 lat/lng coordinates. It also provides
a way to alter the scale if you so desire. Thanks so much Mr.
Appleton! Code included below.

So now I've got a new problem, now that all my coordinates are mapped
and all is good in the projection world. My map (
http://library.ucf.edu/Administration/Maps/Default_unpublished.asp?develop=1
) initializes with one of my custom map types, which has been setup to
use the custom projection. However, when the map draws for the first
time it's still using the default mercator projection. Switching from
and back to one of the custom map types invokes the new Euclidean
projection, as well as any subsequent time, the way it's supposed to.
(Maps JS file: http://library.ucf.edu/Web/Js/Maps.js )
It feels like I need to move some of my code around so the map knows
to use the new projection instead of the default, but I'm not sure
which code needs to move. I've tried moving the relevant code, but it
didn't seem to have any effect. (Relevant code being anything that
refers to a LatLng() coordinate on the custom maps.)

I feel like I'm so close to getting it right. I just need a little
guidance in the right direction.

In a separate issue, I don't really understand how to tell the
polygons and markers to not wrap, and just stay on the original map
region.

P.S. The computer status polygons on the floormaps have not been
remapped since the new flat projection was finished.

function EuclideanProjection() {
var EUCLIDEAN_RANGE = 256;
this.pixelOrigin_ = new google.maps.Point(EUCLIDEAN_RANGE / 2,
EUCLIDEAN_RANGE / 2);
this.pixelsPerLonDegree_ = EUCLIDEAN_RANGE / 360;
this.pixelsPerLonRadian_ = EUCLIDEAN_RANGE / (2 * Math.PI);
this.scaleLat = 2; // Height - multiplication scale factor
this.scaleLng = 1; // Width - multiplication scale factor
this.offsetLat = 0; // Height - direct offset +/-
this.offsetLng = 0; // Width - direct offset +/-
};

EuclideanProjection.prototype.fromLatLngToPoint = function(latLng,
opt_point) {
var point = opt_point || new google.maps.Point(0, 0);

var origin = this.pixelOrigin_;
point.x = (origin.x + (latLng.lng() + this.offsetLng ) *
this.scaleLng * this.pixelsPerLonDegree_);
// NOTE(appleton): Truncating to 0.9999 effectively limits latitude
to
// 89.189. This is about a third of a tile past the edge of the
world tile.
point.y = (origin.y + (-1 * latLng.lat() + this.offsetLat ) *
this.scaleLat * this.pixelsPerLonDegree_);
return point;
};

EuclideanProjection.prototype.fromPointToLatLng = function(point) {
var me = this;

var origin = me.pixelOrigin_;
var lng = (((point.x - origin.x) / me.pixelsPerLonDegree_) /
this.scaleLng) - this.offsetLng;
var lat = ((-1 *( point.y - origin.y) / me.pixelsPerLonDegree_) /
this.scaleLat) - this.offsetLat;
return new google.maps.LatLng(lat , lng, true);
};

// Apply it with this
myCustomMapType.prototype.projection = new EuclideanProjection();

Ben Appleton

unread,
Mar 10, 2010, 2:59:07 AM3/10/10
to google-map...@googlegroups.com
Wrapping is fundamental to the Maps API, since afterall the world wraps.  But you can hide that wrapping by using a small longitudinal range and zooming in, so that the wrapping is hidden way offscreen to the left/right.

But I see the issue you describe: your custom projection does not seem to take effect until the map type changes away and back again.  Do you have a simpler example page that demonstrates this issue?

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

Brak

unread,
Mar 10, 2010, 8:02:20 AM3/10/10
to Google Maps JavaScript API v3
Thanks Ben. I think I'm starting to think with Portals finally. I
reread the whole discussion along with your new post and am now
understanding the whole issue along with my options. What would you
suggest as a good upscale ratio? Right now, the flat map's coordinates
range from -180 west to 180 east and 90 north to -90 south. Maybe
scale it up to -10 west to 10 east and 10 north to -10 south? What
would make most sense?

Sadly I don't presently have a simplified version available at the
moment, but that doesn't mean I can't build one soon. My Maps.js file
really only looks enormous because of all the abandoned commented-out
code. When developing I usually leave old code in for a while, and
delete it when I'm more satisfied with the final product. I'll pull
together a simple(r) version with the custom map, the custom
projection, some example lines, and a built-in alternate map.

On Mar 10, 2:59 am, Ben Appleton <apple...@google.com> wrote:
> Wrapping is fundamental to the Maps API, since afterall the world wraps.
>  But you can hide that wrapping by using a small longitudinal range and
> zooming in, so that the wrapping is hidden way offscreen to the left/right.
>
> But I see the issue you describe: your custom projection does not seem to
> take effect until the map type changes away and back again.  Do you have a
> simpler example page that demonstrates this issue?
>
>
>
> On Wed, Mar 10, 2010 at 9:17 AM, Brak <brak.steph...@gmail.com> wrote:
> > After spending a week and a half scratching my head with various
> > examples I scrapped it and found a new one to work from.
> > Coincidentally it was written by this board's very own Ben Appleton!
>
> > It properly maps the original 256x256 starting tile to top letf:
> > 90,-180 by bottom right: -90,180 lat/lng coordinates. It also provides
> > a way to alter the scale if you so desire. Thanks so much Mr.
> > Appleton! Code included below.
>
> > So now I've got a new problem, now that all my coordinates are mapped
> > and all is good in the projection world. My map (
>

> >http://library.ucf.edu/Administration/Maps/Default_unpublished.asp?de...

Brak

unread,
Mar 10, 2010, 11:34:50 AM3/10/10
to Google Maps JavaScript API v3
I've got my simple example ready and here's what it does. The map
initializes and sets the default map type to "Tile #s" (CoordMapType)
which uses the Euclidean projection, specified earlier, yet draws
using the Mercator projection. When you switch to Satellite or Map
type, then back to "Tile #s" (CoordMaptType) the projection is drawn
properly.

http://library.ucf.edu/testing/Systems/Library_Maps_Google/ProjectionTest.html

Does this look like a my-code problem or a more general API issue?
Dun dun dunnnnn!

> ...
>
> read more »

Ben Appleton

unread,
Mar 10, 2010, 6:46:56 PM3/10/10
to google-map...@googlegroups.com
Thanks, that's very helpful.  This certainly looks like an API bug; we'll look into it.

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

Brak

unread,
Mar 11, 2010, 12:10:03 PM3/11/10
to Google Maps JavaScript API v3
Should I create an issue ticket in the official bug tracker?
http://code.google.com/p/gmaps-api-issues/

On Mar 10, 6:46 pm, Ben Appleton <apple...@google.com> wrote:
> Thanks, that's very helpful.  This certainly looks like an API bug; we'll
> look into it.
>
>
>
> On Thu, Mar 11, 2010 at 3:34 AM, Brak <brak.steph...@gmail.com> wrote:
> > I've got my simple example ready and here's what it does. The map
> > initializes and sets the default map type to "Tile #s" (CoordMapType)
> > which uses the Euclidean projection, specified earlier, yet draws
> > using the Mercator projection. When you switch to Satellite or Map
> > type, then back to "Tile #s" (CoordMaptType) the projection is drawn
> > properly.
>

> >http://library.ucf.edu/testing/Systems/Library_Maps_Google/Projection...

> ...
>
> read more »

Ben Appleton

unread,
Mar 11, 2010, 4:28:49 PM3/11/10
to google-map...@googlegroups.com

Yes, that will let you track progress.  We'll link the internal bug to the external issue tracker item.

On 12 Mar 2010 04:10, "Brak" <brak.s...@gmail.com> wrote:

Should I create an issue ticket in the official bug tracker?
http://code.google.com/p/gmaps-api-issues/


On Mar 10, 6:46 pm, Ben Appleton <apple...@google.com> wrote:

> Thanks, that's very helpful.  This ...

> On Thu, Mar 11, 2010 at 3:34 AM, Brak <brak.steph...@gmail.com> wrote:

> > I've got my simple exam...

> >http://library.ucf.edu/testing/Systems/Library_Maps_Google/Projection...

>
> > Does this look like a my-code problem or a more general API issue?
> > Dun dun dunnnnn!
>

> > ...

> ...
>
> read more »

--
You received this message because you are subscribed to the Google Groups...

Brak

unread,
Mar 12, 2010, 9:43:01 AM3/12/10
to Google Maps JavaScript API v3
For reference, here's the related external issue ticket:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=2230

I've also noticed a new issue that I don't believe is fixable from the
outside, but I could certainly be wrong. I had actually assumed that
it would correct itself after I remapped my points/polygons to the new
coordinate system, but that proved to be naive and not based on fact.
Well, the Markers fit well with the new coordinate system, but the
polygons seem to repeat without respect to the (now larger, scaled up)
projection. I assume this is because they are tied to the tile
overlay, which is sort of directly bound to the original Google Map
tiles. The funny thing is that they accept the new projection's
coordinates and draw properly, they just repeat when the world tile
would have repeated had the projection not been there at all
(basically they are tied to live inside that 256x256 0,0 at zoom level
0 box that the whole world fits in on a standard map.

I've included 2 links to help explain my issue. The first is a live
working example, but it's in an almost production environment, so
there's a lot of other stuff going on (which I believe is irrelevant,
but should be stated none the less). You have to switch to Satelite
then back to a floor map, then you can drag the marker around to see
the actual coordinates, and see that the points where the repeating
polygons are, are in fact incorrect or as I've been calling them,
ghost polygons.
http://library.ucf.edu/Administration/Maps/Default_unpublished.asp?develop=1

The second is a PDF file I drew to illustrate the point more clearly.
It should explain more clearly (possibly more clearly than all the
above text).
http://library.ucf.edu/testing/Systems/Library_Maps_Google/GoogleCustomProjectionBug.pdf

Does this make sense? I hope I explained it properly.
Thanks.

On Mar 11, 4:28 pm, Ben Appleton <apple...@google.com> wrote:
> Yes, that will let you track progress.  We'll link the internal bug to the
> external issue tracker item.
>

> On 12 Mar 2010 04:10, "Brak" <brak.steph...@gmail.com> wrote:
>
> Should I create an issue ticket in the official bug tracker?http://code.google.com/p/gmaps-api-issues/

Ben Appleton

unread,
Mar 15, 2010, 1:26:09 AM3/15/10
to google-map...@googlegroups.com
Thanks, I see the poly wrapping issue.  I'll take a look.

Brak

unread,
Mar 17, 2010, 2:20:12 PM3/17/10
to Google Maps JavaScript API v3
Any luck with the wrapping issue? (I don't mean to be a pest.)

> >http://library.ucf.edu/Administration/Maps/Default_unpublished.asp?de...


>
> > The second is a PDF file I drew to illustrate the point more clearly.
> > It should explain more clearly (possibly more clearly than all the
> > above text).
>

> >http://library.ucf.edu/testing/Systems/Library_Maps_Google/GoogleCust...

> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>

Ben Appleton

unread,
Mar 17, 2010, 6:04:21 PM3/17/10
to google-map...@googlegroups.com

Nothing yet.  Meanwhile, increase your zoom by 8 and divide your projection's points by 256 to hide the wrapping.

On 18 Mar 2010 05:20, "Brak" <brak.s...@gmail.com> wrote:

Any luck with the wrapping issue? (I don't mean to be a pest.)


On Mar 15, 1:26 am, Ben Appleton <apple...@google.com> wrote:

> Thanks, I see the poly wrapping iss...

> On Sat, Mar 13, 2010 at 1:43 AM, Brak <brak.steph...@gmail.com> wrote:

> > For reference, here's t...

> >http://library.ucf.edu/Administration/Maps/Default_unpublished.asp?de...

>
> > The second is a PDF file I drew to illustrate the point more clearly.

> > It should explain mo...

> >http://library.ucf.edu/testing/Systems/Library_Maps_Google/GoogleCust...

>
> > Does this make sense? I hope I explained it properly.
> > Thanks.
>

> > On Mar 11, 4:28 pm, Be...

> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>

> > .
> > For more options, visit this group at

> >http://groups.google.com/group/google-maps-js-api...

--

You received this message because you are subscribed to the Google Groups "Google Maps JavaScript AP...

Brak

unread,
Mar 19, 2010, 9:01:54 AM3/19/10
to Google Maps JavaScript API v3
Interesting idea. I wouldn't even need to change all my stored
coordinate values, just do the division on the fly when I construct
the markers and poly coordinates.

Is there an *easy* way to set a minimum zoom level? I know you can set
a max, but a min? I'd like to have the UI reflect the new min if
possible. Intercepting the zoom_changed event and capping and
resetting the user's zoom seems really clunky but may be the only
option. Just adding 8 to the zoom level during a zoom_changed event
would probably create an infinite loop of zooming, where you would
eventually be able to see atoms <Sorry there's no map imagery for that
zoom level>. Alternatively, if I could somehow intercept the zoom
before it happened, I could adjust the zoom level and essentially put
an +8 offset into the zoom, so level 0 becomes 8, 1->9 etc. The UI
controls would still reflect the 0 end of the zoom scale and all would
be well.

On Mar 17, 6:04 pm, Ben Appleton <apple...@google.com> wrote:
> Nothing yet.  Meanwhile, increase your zoom by 8 and divide your
> projection's points by 256 to hide the wrapping.
>

Ben Appleton

unread,
Mar 19, 2010, 9:20:21 AM3/19/10
to google-map...@googlegroups.com

Adding a min zoom is a good idea, we should take a look.  Meanwhile I recommend capping zoom in zoom_changed.

On 20 Mar 2010 00:02, "Brak" <brak.s...@gmail.com> wrote:

Interesting idea. I wouldn't even need to change all my stored
coordinate values, just do the division on the fly when I construct
the markers and poly coordinates.

Is there an *easy* way to set a minimum zoom level? I know you can set
a max, but a min? I'd like to have the UI reflect the new min if
possible. Intercepting the zoom_changed event and capping and
resetting the user's zoom seems really clunky but may be the only
option. Just adding 8 to the zoom level during a zoom_changed event
would probably create an infinite loop of zooming, where you would
eventually be able to see atoms <Sorry there's no map imagery for that
zoom level>. Alternatively, if I could somehow intercept the zoom
before it happened, I could adjust the zoom level and essentially put
an +8 offset into the zoom, so level 0 becomes 8, 1->9 etc. The UI
controls would still reflect the 0 end of the zoom scale and all would
be well.


On Mar 17, 6:04 pm, Ben Appleton <apple...@google.com> wrote:

> Nothing yet.  Meanwhile, increase y...

> On 18 Mar 2010 05:20, "Brak" <brak.steph...@gmail.com> wrote:
>

> Any luck with the wrapping issue...

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


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.

Brak

unread,
Mar 19, 2010, 2:15:42 PM3/19/10
to Google Maps JavaScript API v3
Having a minZoom would be really cool. That's one of the first things
I tried to do on my first maps in v3.

This workaround is funny though, because now I have to manually cap
the min AND the max for two different reasons. The latter because of
this bug: http://code.google.com/p/gmaps-api-issues/issues/detail?id=2177
Hopefully research into minZoom will reveal the cause and solution to
the maxZoom bug.

Good luck!

On Mar 19, 9:20 am, Ben Appleton <apple...@google.com> wrote:
> Adding a min zoom is a good idea, we should take a look.  Meanwhile I
> recommend capping zoom in zoom_changed.
>

> google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>

Blake Stephens

unread,
Mar 24, 2010, 10:33:29 AM3/24/10
to Google Maps JavaScript API v3
Did you guys just add the minZoom to the custom map type??? Wow! I
don't remember seeing it earlier.

On a whim, I was going to add my own property to my CustomMapType
prototype, using the key minZoom that I'd read back later to do some
calculations with. I saved my page, reloaded it and noticed that it
actually did work, exactly as I was hoping it would, adjusting the
zoom control UI and everything.

If this is in fact new, THANK YOU! If not, please excuse my ignorance.

On Mar 19, 9:20 am, Ben Appleton <apple...@google.com> wrote:
> Adding a min zoom is a good idea, we should take a look.  Meanwhile I
> recommend capping zoom in zoom_changed.
>

> google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>

Brian David

unread,
Apr 13, 2011, 9:06:47 AM4/13/11
to google-map...@googlegroups.com
Greetings...  Blake...   I've wondered about this for about as long as this thread is old.   You have some wonderful work here.

I am nowhere near as capable of these things so I humbly ask and wonder if someone actually needed 2 simple static maps... made into Google maps,,, assigned to a api  for use with a key in a mission assignment/ event based posting application.   Where would one go to achieve these results?  Is this something that can easily be done?  Our maps are given plenty of elements to support your proposed ideas in this thread.  I would of course be available and dedicated to achieve the desired results in whatever capacity that I am able.
I am  in need of a dynamic element created for a Bohemia Interactive MILSIM training platform where users may be able to coordinate with a Google map of a static environment using the MILSIM battle-space on a networked website.

If this is a discussion that you might be interested in having with me you can contact me anytime.... if not however, it is not my intention to impose myself upon others.  

Thanks for reading

B.David
Reply all
Reply to author
Forward
0 new messages