Giter VIP home page Giter VIP logo

mean-geographic-google-maps's Introduction

MEAN-Geographic-Google-Maps

Using Google Maps + MEAN Stack to work with geometry Objects

This project is essentially a fork of @Ahmed Haque Making MEAN Apps with Google Maps available at https://github.com/afhaque/MeanMapAppV2.0

If you have ever wondered about using Google Maps Api in a Mean Stack Application and using geoSpatial Queries in MongoDB you can take this project as an example to kickstart your next application.

1.png 2.png

I made different changes to project's structure and added Polyline and Polygon support with some Geospatial Queries on the latter objects.

What you need to run the project:

  • Node ~^4.4.7
  • NPM ~^2.15
  • MongoDB ~^3.2.7
  • Bower ~^1.7.9

How to install bower and npm packages:

  • Go on Project's folder
  • run: bower install
  • run: npm install

How to run the project:

  • if you have nodemon: nodemon server.js
  • else: npm start server.js

Remember to change Google-Maps-Key with yours.

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=yourKey"></script>

Example of Geometry Objects

Point

{ "name" : "point1", "geo" : { "coordinates" : [ 52.483, 16.084 ], "type" : "Point" } }

LineString

{ "name" : "linestring2", "geo" : { "coordinates" : [ [ 38.232, 38.823 ], [ 70.576, 51.289 ], [ 91.67, 59.801 ], [ 91.318, 68.073 ] ], "type" : "LineString" } }

Polygon (it has to be closed -> first point coordinates == last point coordinates)

{ "name" : "polygon1", "geo" : { "coordinates" : [ [ [ 3.779, 9.276 ], [ 14.854, 15.115 ], [ 38.408, 17.309 ], [ 40.693, 7.711 ], [ 35.068, -7.885 ], [ 5.889, -9.622 ], [ 1.143, -3.689 ], [ 3.779, 9.276 ] ] ], "type" : "Polygon" } }

MongoDB Collection

I provided an example collection geometry-collection.json that is possible to import through tools like RoboMongo or MongoChef.

mean-geographic-google-maps's People

Contributors

andream16 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.