GithubHelp home page GithubHelp logo

ign-gmaps's Introduction

How to use the library?

  • Include ign-maps.js and proj4js.js in your project.

You find an uncompressed and unobfuscated Proj4js version in the GitHub repository. A compressed and obfuscated one can be downloaded from http://trac.osgeo.org/proj4js/wiki/Download

  • Make sure you are familiar with the Custom Map chapter of the Google Maps API Developer Guide (http://code.google.com/apis/maps/documentation/javascript/maptypes.html#CustomMapTypes)

  • Configure the IGN map:

    var config = {
        tileScaleForBaseZoom: 256, // in meters/pixel for the zoom 0. Must be a power of 2. Valid scale range: 1 - 2048.
        utmZone: 30, // continental Spain: 29-31, Canary Island: 27-28
        originTileLatLng: new gm.LatLng(44.0, -7.0), // upper-left pixel of the tile covering these coordinates will become (0, 0) world point. Should lie withing the UTM zone or close to its boundaries. The farther it is from the boundaries, the bigger is the projection error
        ignMaps: [
            ign.MAP_TYPES.TOPO_1000, // IGN map for Google Maps zoom 0; using tile scale of 256 m/px
            ign.MAP_TYPES.TOPO_1000, // IGN map for Google Maps zoom 1; tile scale of 128 m/px
            ign.MAP_TYPES.TOPO_200,  // IGN map for Google Maps zoom 2; tile scale of 64 m/px
            ign.MAP_TYPES.TOPO_200,  // ...
            ign.MAP_TYPES.TOPO_50,
            ign.MAP_TYPES.TOPO_50,
            ign.MAP_TYPES.TOPO_25,
            ign.MAP_TYPES.TOPO_25,
            ign.MAP_TYPES.TOPO_25   // IGN map for Google Maps zoom 8 => thus max. zoom = 8; tile scale of 1 m/px
        ]
    }
    
  • Use ign.IgnMapFactory to create an IGN map layer. It will provide a custom ImageMapType together with MapOptions and Projection implementation:

    var ignMapType = ign.IgnMapFactory.createMapType(config)
    var map = new google.maps.Map(document.getElementById("map_viewport"))
    map.setCenter(new google.maps.LatLng(43.0, -3.0))
    map.setZoom(0)
    map.mapTypes.set("ignMap", ignMapType)
    map.setMapTypeId("ignMap")
    map.overlayMapTypes.insertAt(0, ignMapType)
    

Notes

  • IGN tile scales are not compatible with Google Maps tile scales. It means that for a given IGN tile scale (e.g. 256 m/px) there is no 1:1 mapping to a Google map scale (e.g. road map at zoom 7)

TBD

  • Build system producing a minified version of the library
  • Documentation about the IGN tile server
  • Support for aerial imagery
  • Automatic switching of UTM zone

ign-gmaps's People

Stargazers

Shoaib Burq avatar

Watchers

James Cloos avatar

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.