Skip to content
This repository

The example on http://modestmaps.com/ doesn't work now #126

Open
jamierytlewski opened this Issue · 2 comments

2 participants

Jamie R. Rytlewski Tom MacWright
Jamie R. Rytlewski

If I try and run the code:

map.setCenter({ lat: 51.55, lon: 0.1 }).setZoom(10);

It no longer works in the newest beta. This works:

map.setCenterZoom(new MM.Location(51.55, 0.1), 10);

Even the wiki on page https://github.com/stamen/modestmaps-js/wiki shows code like:

map.setCenter(new MM.Location(37.7749295, -122.4194155));
map.setCenterZoom(new MM.Location(37.7749295, -122.4194155), 11);
map.setZoom(11);

Which the middle line is duplicating what the 1st and 3rd lines do, but if you take out the 2nd line, the chaining doesn't work. It ends up putting the zoom somewhere that is not centered properly;

Tom MacWright
Collaborator
tmcw commented

Hi Jamie,

Zoom before you pan:

map.setZoom(10).setCenter({ lat: 51.55, lon: 0.1 });

As far as your wiki example; you're concatenating different examples, right? I don't see that code anywhere on the wiki as one segment.

Jamie R. Rytlewski

I made a change to the wiki example...I probably should've left it first. Of course, the website where you get the info from, has an older version (an alpha version) and the code if I was to copy/paste does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.