Home

Awesome

<!-- TABLE OF CONTENTS --> <details open="open"> <summary><h2 style="display: inline-block">Table of Contents</h2></summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li><a href="#examples">Examples</a></li> <li><a href="#installation">Installation</a></li> <li> <a href="#usage">Usage</a> <ul> <li><a href="#recommendations">Recommendations</a></li> </ul> </li> <li><a href="#documentation">Documentation</a></li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#acknowledgements">Acknowledgements</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

About The Project

Product Name Screen Shot

Vector Tiles Google Maps is a JavaScript library to render vector tiles in Google Maps.

The library provides funcionality to enable cache, filter features, apply styles, onclick event, mouse hover, and show/hide layers.

Further work would be to load Mapxbox GL Styles in Google Maps.

Built With

<!-- DEMO EXAMPLES -->

Examples

<!-- INSTALATION -->

Installation

  1. Clone the repo
    git clone https://github.com/techjb/Vector-Tiles-Google-Maps.git
    
  2. Install NPM packages
    npm install
    
  3. Get your own API Key for the Maps JavaScript API and replace it in all the provided examples
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY" defer></script>
    
<!-- USAGE EXAMPLES -->

Usage

Create the MVTSource object and then insert it as a overlayMapType. Provide the vector tiles server url in the options object.

var options = {
    url: "http://your_vector_tiles_url/{z}/{x}/{y}.pbf"
};

var mvtSource = new MVTSource(map, options);
map.overlayMapTypes.insertAt(0, mvtSource);

Recommendations

 google.maps.event.addListenerOnce(map, 'tilesloaded', function () {
    map.overlayMapTypes.insertAt(0, mvtSource);
});
var options = {    
    getIDForLayerFeature: function(feature) {
        return feature.properties.id;
    }
};
var options = {    
    cache: true
};
var options = {    
    sourceMaxZoom: 14
};
<!-- DOCUMENTATION -->

Documentation

See documentation for the contructor options and public methods.

<!-- ROADMAP -->

Roadmap

See the open issues for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
<!-- LICENSE -->

License

See license for more information.

<!-- CONTACT -->

Contact

Jesús Barrio - @techjb

Project Link: https://github.com/techjb/Vector-Tiles-Google-Maps

<!-- ACKNOWLEDGEMENTS -->

Acknowledgements

<!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->