GithubHelp home page GithubHelp logo

nkalodimas / serviced-areas Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8 KB

A proof of concept app that allows the user to store geographic areas, through the use of Google Maps API and check if a spot belongs to any of the previously stored areas

Python 55.13% HTML 44.87%

serviced-areas's Introduction

This web application was built using Django Framework, PostgreSql with the use of PostGIS, in order to enable the use of location queries, GoogleMaps API and JQuery. It is hosted on an Amazon EC2 server and you can access it on the following url:

http://ec2-54-213-202-239.us-west-2.compute.amazonaws.com:8000/areas/

It consists of 2 web pages: 1) http://ec2-54-213-202-239.us-west-2.compute.amazonaws.com:8000/areas/create and

http://ec2-54-213-202-239.us-west-2.compute.amazonaws.com:8000/areas/check

Through the first page a user can see a Google Maps map and can draw a polygon that represents the area for which he can provide his services. After drawing the polygon the user can also modifie it and afterwards can submit the area. The coordinates of the last submitted area are displayed on the top of the page. The clear button does not function properly yet. The user can submit multiple areas, one at a time.

Through the second page the user can check if a single point, that he pins on the map belongs to a serviced area that has previusly been submitted. When the user pins the mapper a flash message appears on the top of the screen and the mapper's colour also changes according to the result. If the point is serviced it becomes green and if not it becomes purple. The user can pin multiple points and view them all inside the map.


API documentation

Submit an Area

Returns only status.

  • URL

    /areas/submit

  • Method:

    POST

  • Data Params

    Required:

    json dictionary with key='points' and value=list of objects of type:{'lat':value , 'long':value} example: { 'points' : [{lat: 25.774, lng: -80.190},{lat: 18.466, lng: -66.118},{lat: 32.321, lng: -64.757},{lat: 25.774, lng: -80.190}] }

  • Url Params

    None

  • Success Response:

    • Code: 201
      Content: None
  • Error Response:

    • Code: 400 BAD REQUEST
  • Sample Call:

      $.ajax({
      		url  : 'submit/',
      		type : 'POST',
      		data : JSON.stringify({"points" : points })
      		})

Search for an Area

Returns only status.

  • URL

    /areas/search

  • Method:

    GET

  • Data Params

None

  • Url Params

    Required:

    lat=[float] lng=[float]

  • Success Response:

    • Code: 200
      When: Found

    OR

    • Code: 204
      When: Not found
  • Error Response:

    • Code: 400 BAD REQUEST
  • Sample Call:

      $.ajax({
      		url  : 'search/',
      		type : 'GET',
      		data : {"lat" : location.lat(),"lng" : location.lng()}
      		})

serviced-areas's People

Contributors

nkalodimas avatar

Watchers

 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.