Code Monkey home page Code Monkey logo

Comments (19)

markmarkoh avatar markmarkoh commented on May 19, 2024

agreed. Currently it's "whole world" or "just USA". I want to add different zoom levels to different continents.

So maybe:

$("#map").datamaps({ zoom: 'SouthAmerica' });

Which would essential be a World map but zoomed in on the center of South America.

You think that would be enough?

from datamaps.

ckiikc avatar ckiikc commented on May 19, 2024

Is there a way to buil your js coordinates starting from gps one?

from datamaps.

markmarkoh avatar markmarkoh commented on May 19, 2024

You can now specify scopes such as:

  • southAmerica
  • middleEast
  • africa
  • europe
  • asia
  • southeastAsia
  • australia
  • world
  • usa

with the latest version.

after commit: 5f9ca3b

from datamaps.

markmarkoh avatar markmarkoh commented on May 19, 2024

example at http://datamaps.github.com/#scopes

from datamaps.

rafagarcia avatar rafagarcia commented on May 19, 2024

Great work indeed.

from datamaps.

maerkip avatar maerkip commented on May 19, 2024

Is this no longer supported in the newest version? It's working fine for scope world and usa, but for other scopes I get this error:

[03:27:49.989] TypeError: a is undefined @ http://localhost:8888/datamaps/datamaps.all.min.js:1

from datamaps.

kylemclaren avatar kylemclaren commented on May 19, 2024

Hi there,

zoom doesn't appear to be supported anymore?
I'd like to "zoom" in on Africa only.

Will I need to get custom map data or is there some way that is supported out the box?

from datamaps.

kylemclaren avatar kylemclaren commented on May 19, 2024

Never mind, I've just seen the "zoom" branch.
Will give it another attempt.

from datamaps.

markmarkoh avatar markmarkoh commented on May 19, 2024

@kylemclaren: you don't need custom map data, but you probably want to take advantage of a custom projection.

For Africa, it'd look something like this:

http://jsbin.com/EjOHuliN/2/edit

You can mess with the scale, center and translation to move it into place.

The zoom branch is outdated, I changed my approach to zooming by exposing more d3 instead of abstracting it (as in, allowing you to specify your projection and all the options).

from datamaps.

kylemclaren avatar kylemclaren commented on May 19, 2024

@markmarkoh Brilliant! Thanks for the quick reply. Let me see what I can make happen...

from datamaps.

idekov-hf avatar idekov-hf commented on May 19, 2024

Hey, how would I get a map centered on Europe?

from datamaps.

trsonderm avatar trsonderm commented on May 19, 2024

@ivdekov change your projection to europe:

var projection = d3.geo.equirectangular()
        .center([10, 50])
        .rotate([4.4, 0])
        .scale(1500)
        .translate([element.offsetWidth / 2, element.offsetHeight / 2]);
      var path = d3.geo.path()
        .projection(projection);

from datamaps.

dharmjit avatar dharmjit commented on May 19, 2024

Hi All, this is an awesome library and I am using custom map feature of it. I have Senegal Topojson and its not showing in the visual area. I guess I need to set projection correctly, but I am not getting anywhere near to find the values for scale,translate and center. Is there any method to find the values of scale and translate. Thanks

from datamaps.

FreelanceWebNinja avatar FreelanceWebNinja commented on May 19, 2024

Sorry for the necropost(?), but it appears the additional scopes are not working:

Uncaught TypeError: Cannot read property 'objects' of undefined

from datamaps.

Anujarya300 avatar Anujarya300 commented on May 19, 2024

@markmarkoh
Really appreciated the work you guys have done. But the datamap only supports for World and USA map and no other countries. But I need to use Canada, Brazil maps.

Can you help me how to use the maps of other countries or give me some idea about the map data and rendering, so that I can fix it.

Thanks!

from datamaps.

Anujarya300 avatar Anujarya300 commented on May 19, 2024

By doing some brain storming in the weekend, able to come up with something. I have created demo files for India, Canada etc which shows bubble map.
https://github.com/Anujarya300/bubble_maps.

Thanks @markmarkoh

from datamaps.

markmarkoh avatar markmarkoh commented on May 19, 2024

@Anujarya300 that looks really great. I'd love to have that README available in this project, along with those examples. Feel like sending a pull request?

from datamaps.

Anujarya300 avatar Anujarya300 commented on May 19, 2024

@markmarkoh, Sure, I'd love to put a pull request.

from datamaps.

mcv avatar mcv commented on May 19, 2024

I notice all zoom examples use hard-coded coordinates. It would be nice if it was possible to get these coordinates from the continent you're zooming in on. This is possible with countries, but I have no idea if this is also possible with continents. You may have to compare all the bounding boxes of all the countries in that continent, take the min and max of that, and then average the min and max.

from datamaps.

Related Issues (20)

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.