Giter Site home page Giter Site logo

modestmaps-js's People

Contributors

ansis avatar armoucar avatar chrisforbes avatar creade avatar dbaron avatar gmaclennan avatar migurski avatar randometc avatar shawnbot avatar swatinem avatar tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modestmaps-js's Issues

Support disabling layers

Via @Aibram there are some kinks in layer management that we're seeing both building larger sites on top of this and just managing a few layers - notably that one can only remove layers at indices, and so you need to do a lot of records-keeping to figure out where layers should fall in the stack.

Maps with CSS direction: rtl render incorrectly

A map element whose parents have the CSS direction property set to rtl will render incorrectly, with results ranging from totally borked to "almost normal".

I don't know if it makes sense for mapbox.js to set style="direction: ltr; on map elements, but given that all of the tile and marker positioning relies on that assumption, I'd at least document this somewhere.

Cheers!

(from mapbox/mapbox.js#135 )

Host demos online

It would be useful to make a more usable, public version of the examples/ dir - would this just work on the github branch?

from stamen#116

disable infinite scrolling

Heyho,
First of all: GREAT PROJECT!

I am wondering whether it is possible to prevent an infinite scrolling on the x-axis? Like it is standard for the y-axis.

Thus the map would only be scrollable if the zoom level doesn't fit into the viewport.

Thank you,
Regards,

J

If you had to use a projection other than 900913, how would you do it?

I'm experimenting with some alternate projections. I'm scratching my head a little trying to figure out the best way to make this work with modest maps, since the spherical mercator projection is hardcoded into the Map constructor. @tmcw or @shawnbot, if you were to add support for arbitrary projections, where would you do it? Would you have the Map object pick up the projection from the first layer it sees? Should it be possible to simply re-assign map.projection after an instance is created? I'm thinking it shouldn't and that picking up a projection from the first defined layer is the right way to go, and reassigning .projection is getting me some weird behaviors.

If you're curious, here's some sample code that I already know works on the server side in TileStache and I've verified that all the math is correct: https://gist.github.com/2691614

Confusing repositories.

Hi,
I am confused as to which repository to follow\fork.. There is this one and then there is the other under stamen/modestmaps-js.
Which one is up to date or the main one?
Clarification on this would be highly appreciated.
-David.

Should setLayerAt tolerate layers added to the end of the layers array?

/cc @migurski @shawnbot

Right now if you have a map with a 'base layer' and an 'overlay' and you have a function that sets a new overlay, you need a bit of code like

if (map.getLayers().length == 1) {
  map.insertLayerAt(1, new layer());
} else {
  map.setLayerAt(1, new layer());
}

I can't find a good example of the set/insert semantics anywhere else to reference, but it seems like this function should be more permissive and tolerate 'setting' layers at higher indices than are present.

keyboard handlers in core

It'd be nice to promote the examples/ version of a keyboard control into core; it's pretty small code-wise and I often miss keyboard-nav.

npm repo failures

I frequently see the first fetch of npm to get modestmaps fails (and its only mm that I see this for). Is there anything custom about the npm upload of MM that might be causing this? It ultimately succeeds as it appears npm retries, but I figured I should log an issue nevertheless in case something might need fixing:

Below output happens to be from windows, but I've seen this on OS X as well:

Set crossOrigin

There appear to be no side-effects from doing this when cors is not available, and it's terribly useful when doing image manipulation (and there's no easy way to do this outside of modestmaps besides hacking the library or re-requesting tiles).

IE10 touch support

  1. Buy a Microsoft Windows Touch Compatible Internet Explorer 10 Surface
  2. Fix MM in it?

Simplify setting pan limits

Would it be appropriate to add map.setPanLimits? In a way, it would be the other half of map.setZoomRange.

Something like:

    setPanLimits: function(locations) {
        if (locations instanceof MM.Extent) {
            locations = locations.toArray();
        }
        this.coordLimits = [
            locations[0].zoomTo(this.coordLimits[0].zoom), 
            locations[1].zoomTo(this.coordLimits[1].zoom) 
        ];
        return this;
    }

Improve parent-tile handling when some 404s are present

We're running into problems with sparse tilesets in which a single 404 can block the removal of a parent tile, leading to the awful sustained-blurry-big tile problem. Should take a closer look at this code to come out with a better averaging of the two priorities:

  1. Don't flash white no-tiles content when zooming in / out
  2. Remove the parent tile when all requests have finished, even if they were in error

This problem might lead to a solution for #16 as well.

Default zoom level

Should modestmaps automatically set a reasonable zoom level for newly initialized maps? Or is this problematic when users will reset it quickly with .zoom()?

Gracefully handle 404 tiles

Sparse tilesets have lots of 404s, and so pose two problems: parent tiles are not pulled out of the DOM when their children have failures, and 404 tiles themselves look weird.

This would be simple if we didn't consider IE7, which has 1-5% market share, so is barely worth considering.

Anyway,

The options are:

  • data-urls (break in IE7! with broken image icon yay)
  • a real blank image? kill me now
  • non-image elements
  • managing 404s in another queue or something (IE7 has no right to introduce complexity here)
  • display:none, with extra magic to make it sticky in positionTile

The final option is

  • Drop IE7 support

Switch from YUICompressor

YUICompressor has done us well but many systems are shipping without Java, so its benefit of being installation-free is fading. A good option would be uglifyjs, with a fallback to google closure compiler on appspot for the no-install option.

Scrollzoom off on maps with fixed position

Test case:

http://bl.ocks.org/4601671

From MapBox Support 954

When loading the JS API into a "position: fixed" modal, if you scroll the page past the fold and then zoom in and out via mousewheel, the zoom center point is off zia the same distance the page has scrolled.

Using the code from the mouse position tutorial ( http://mapbox.com/mapbox.js/example/mouse-position/ ), when at the top of the document, the mouse y is 0 when at the top of the map container. The more you scroll down the page, position the cursor at the top of map container, it no longer reads 0, but an offset of how far the page has scrolled.

I've tried CSS position "static", "relative", "absolute" and widths and heights on the map container and it's parents, upto the modal container.

If looks like the zoom point is calculated via the mouse position on the document, not via the window. Is this a know issue or is there a fix?

Problems starting Node.js example

When I try to run the modestmaps-static.js example I get the following stack trace:

/Users/christopherf/Documents/src/github/printlet/node_modules/modestmaps/examples/node/modestmaps-static.js:104
  osm: new MM.TemplatedLayer("http://tile.openstreetmap.org/{Z}/{X}/{Y}.png")
       ^
TypeError: undefined is not a function
    at Object.<anonymous> (/Users/christopherf/Documents/src/node_modules/modestmaps/examples/node/modestmaps-static.js:104:8)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

I installed modestmaps version 3.3.5 with npm install modestmaps on OSX 10.8.

I tried debugging with node-inspector and the MM object doesn't look like the API described in the Wiki. Most importantly TemplatedLayer dosen't exist, although I can find the declaration in the source file modestmaps.js.

What am I doing wrong?

Map re-initalization behavior

A behavior that I see a lot in projects is something like this:

var currentLayers = ['test'];

function buildMap() {
  var map = new MM.Map('map');
  map.addLayer(currentLayers)
}

document.getElementById('button').onclick = buildMap;

Excuse the psuedocode but the point should be clear: many users call MM.Map on the same element more than once. I think for defining the behavior of Modest Maps it's important to say what it should do here. Should new MM.Map return an existing map if one has been created that references that element? Or should it add multiple maps in the same container, with declared effects? Or throw an error?

I think the first - to return an existing map when re-called - would be the most 'user friendly' since it would also save some users from having to scope a map variable specially in order to reference their maps. But maybe it's problematic in other ways?

Thoughts, @migurski @shawnbot ?

Layers cannot be removed and re-added

The layer destroying code is all too eager about destroying code and indeed destroys our expectations about what happens when you have

var layer = blah();

map.addLayer(layer);
map.removeLayerAt(0);
map.addLayer(layer); // fail

Moving modestmaps.com here?

@tristen has been doing some badass work on an MM examples site: http://tristen.ca/mm-examples/

This brings to a head one problem - that right now modestmaps.com is under stamen/modestmaps-js and we obviously can't fork into stamen, slash don't want to merge another subtree into gh-pages of modestmaps-js as is. So, sorry that it was a long annoying process to do modestmaps.com, but possibly it can be redirected to this organization? /cc @migurski @shawnbot

Factor out tile selection

It'd be nice if the draw function off of map gave a list of tiles that it wanted to load, or there was another way of finding 'tiles needed at a certain extent/map size'. Mainly I want to start working on background tile loading and preloading for stuff like easey, and it wouldn't be terribly challenging if there was such an API. I'll see what this looks like specced out.

from stamen#56

Switch to mocha :/

As soon as chai gets its IE-support act together: chaijs/chai#117

we should switch to mocha. Until then, let's not doing it... since IE testing is what testing is.

Precise setExtent?

Hi, I'm wondering if anyone knows of a way to use setExtent to get a more precise zoom level (with decimal value) as is possible with the mouse wheel handler. Thanks.

Support named layers

I think it would be useful to support layer names. This would allow the layer container divs to be named and styleable via outside CSS and is already supported by polymaps with its id option.

This would be a backwards-compatible new feature - a minor version bump. The bigger question is whether the layer accessor functions should be able to refer to layers by name and not just by index. Thoughts, @migurski & @shawnbot

Remove element code in MM.Layer

MM.Layer is in-between being tile-specific and handling elements. I think it should slim down and there be alternative implementations.

Place marker/bubble on map

Hello !
Firstly, thanks for this awesome plugin. I'm using it with awesome Stamen tiles =)
I made all my construction, and my map is working well with easey (to make smooth moves).

But i cannot success placing markers/bubble on specific coordinate on map.
I tried:

var loc = new MM.Location({lat: -27, lon: 152});
var loc1 = new MM.Location(30, 114);
var point = { x: 10, y: 20 };

But still nothing on the map, i found something with MM.Follower but it not works to.
I'm simply trying to put BUBBLE on map (like in modestmaps example) or simple icon on a specific point. Thanks a lot !

Touch handlers do doubletime

In the latest tag, touch handlers seem to pan at 2x speed. There have not been any recent changes to touch.js so I can't track down the cause.

Remove setProvider

Not clear on whether setProvider provides any benefit over replacing a layer entirely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.