Comments (7)
Can you test with more current version of Modest Maps, like 2.0.0?
from modestmaps-js.
Fails with 2.0.0 too. The code is from http://modestmaps.com/index.html
var template = 'http://c.tiles.mapbox.com/v3/mapbox.mapbox-light/{Z}/{X}/{Y}.png';
var provider = new MM.TemplatedLayer(template);
var map = new MM.Map('map', provider);
map.setCenter({ lat: 42.51, lon: 2.68 }).setZoom(9);
from modestmaps-js.
Ah, that problem. Call setZoom before setCenter; setCenter corrects for zooms that go out of the map's bounds. The example on the site needs an update.
from modestmaps-js.
Yes that worked. Anyway, can't MM remember the center so that it is taken into account when setZoom() is called? IMHO you shouldn't need to know how it works, it should just work.
Thanks!
from modestmaps-js.
Yes, been thinking about this issue; I don't think modestmaps should remember the center (and thus decouple the 'real center' and the 'intended center') but setCenter might not want to, by default, bound the values - the user should need to select 'restrictions' on the map.
from modestmaps-js.
/cc @springmeyer - no bright ideas on a solution here, but I was following the mapbox.js examples for workshop prep and hit, so keen on it working more intuitively.
from modestmaps-js.
Fixed in the main modestmaps repo: f09f960
from modestmaps-js.
Related Issues (20)
- Coordinate -> Extent HOT 3
- anyscale example does not work?
- Remove cache infrastructure HOT 1
- node example broken? HOT 5
- Initialize map without layer HOT 1
- MM.Location bearing method HOT 3
- The example on http://modestmaps.com/ doesn't work now HOT 2
- Latest MM breaks at high zooms in IE8
- Geo code or search by location in modest map HOT 3
- displaying geojson "features" HOT 1
- map rotation HOT 3
- Tiles disappear when max is hit on very large displays HOT 2
- Easey and setExtent HOT 5
- Center Zoom On Click - Wax and Modest Maps
- CallbackManager#dispatchCallback eats exceptions
- IE10 PointerEvents not working properly HOT 1
- PERSIAN GOULF MARITAM POSIT
- License for modestmaps HOT 2
- Which files need to be hosted?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modestmaps-js.