项目作者: joeyzhang1989

项目描述 :
Neighborhood-Map
高级语言: JavaScript
项目地址: git://github.com/joeyzhang1989/Neighborhood-Map.git
创建时间: 2016-10-27T03:13:40Z
项目社区:https://github.com/joeyzhang1989/Neighborhood-Map

开源协议:MIT License

下载


Neighborhood-Map

This is a single page application featuring a map of your neighborhood or a neighborhood you would like to visit. Knockoutjs is usded to automatically bind the data to the view layer(HTML page). Google Maps Api and FourSquare Api are used as third party library and data source. The webpage will change layout due to mobile device or small width window.

Getting started

Live demo on Github Page: Neighborhood-Map.
Locally

1. Clone this repo:

  1. $ git clone https://github.com/joeyzhang1989/Neighborhood-Map.git
  2. `

2. Serve the application:

Python 2
  1. $ python -m SimpleHTTPServer
Python 3
  1. $ python3 -m http.server.

You can use the Python SimpleHTTPServer to serve this webpage game on your local machine.

3. Open the application:

  1. $ open "http://localhost:8000"

Code example

Part 1: Knockout.js

  1. // Model part for the marker
  2. var venueMarkers = function(item) {
  3. };
  4. // VM part for the map render
  5. var mapViewModel = function() {
  6. }

Part 2: Customized the google map style:[Neighborhood-Map](https://snazzymaps.com/style/15/subtle-grayscale,

  1. attributed to the author Paulo Avila)
  1. var styles = [{
  2. "featureType": "administrative",
  3. "elementType": "all",
  4. "stylers": [{
  5. "saturation": "-100"
  6. }]
  7. },

License

This project is a public domain work, dedicated using
MIT. Feel free to do
whatever you want with it.