Giter Site home page Giter Site logo

Comments (7)

neveldo avatar neveldo commented on May 22, 2024

Hello ! I'm glad you appreciate jQuery Mapael.

I'm currently working on a tutorial for creating maps for jQuery mapael. It will be available very soon, with the release of mapael 1.0.0 ! Here is the part regarding the getCoords() function :

"If you want to go further with your map, you may want plot cities by latitude and longitude on it. We assume that the projection of your map is an equirectangular one.

With this projection, the algorithm to convert a latitude and a longitude to x and y coordinates is as simple as that :

x = xFactor + latitude + xOffset
y = yFactor * longitude + yOffset

You just have to found the proper values for xFactor, yFactor, xOffset and yoffset in order to be able to plot cities by latitude and longitude on your map.

To get the values of xFactor and xOffset, you just have to resolve an equation with two unknowns. Plot two points at the max left and the max right of your map with x and y coordinates. Go to Google Map in order to find the matching latitudes for these two points (Right clic > More info about this place on Google map) .

You can now find the values for xFactor and xOffset by resolving this equation (tedious way, there is a tool for that, see below ;-) ) :

x1 = xFactor + latitude1 + xOffset
x2 = xFactor + latitude2 + xOffset

Then, you have to do exactly the same thing to get the values of yFactor and yOffset.

You can use the getCoords() generator tool that will resolve equations and generate the getCoords() method for you !"

The getCoords() generator is available here : http://www.neveldo.fr/mapael/getcoords.php .

I hope it will help you !

from jquery-mapael.

demogorgorn avatar demogorgorn commented on May 22, 2024

Thank you very much for your quick answer!
It's great that you've created automatic coordinates calculator! Thank you for thinking of users!

from jquery-mapael.

neveldo avatar neveldo commented on May 22, 2024

You are welcome :) Feel free to contribute to 'mapael-maps' repository (https://github.com/neveldo/mapael-maps) by adding your brand new map !

from jquery-mapael.

demogorgorn avatar demogorgorn commented on May 22, 2024

Of course I will contribute the new my to the mapael's repository after finishing it. It's a map of Commonwealth of Independent States. Neveldo, thank You very much!

from jquery-mapael.

shahzadasaeed avatar shahzadasaeed commented on May 22, 2024

Hi Neveldo,

I am using this for one of my project. but i am confusing in Coordinates system that is How we can calculate X1, Y1??

Thanks

from jquery-mapael.

neveldo avatar neveldo commented on May 22, 2024

Hi,

All the steps are explained in this tutorial : http://www.vincentbroute.fr/mapael/create-map.php , did you check it ?

from jquery-mapael.

Indigo744 avatar Indigo744 commented on May 22, 2024

Thread close. Open a new thread if you have another issue.

from jquery-mapael.

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.