GithubHelp home page GithubHelp logo

sina-abdous / 3dmapsdjango Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amaanabbasi/3dmapsdjango

0.0 0.0 0.0 34 KB

How to Add Maps + 3D buildings to Django Web App

Python 68.38% HTML 31.62%

3dmapsdjango's Introduction

3DmapsDjango

Adding maps to your Django apps. The following steps will guide you through on how to add maps to your django projects. Along with, displaying 3D buildings. I have used Mapbox api for this project.

Sign-up for Mapbox

Head to the Mapbox. Click on "Get started". Sign up for a free account. Once you have signed in, Click the "JS Web" option. Then, choose "Use the Mapbox CDN" to install Mapbox GL JS. Once you have done that you will be provided with a access token, like this one "pk.eyJ1IjoIcGVuh29veCIsImEiOiJjampHNshreDkwbGZ5M3BxbXZkdDQ0dGdpIn1.-36WPGfz6NY90m3trPkNyw".

2018-07-08 1

Getting started

  • Clone the repository.
  • Create a virtual environment.

python -m venv djangomaps

  • Activate the virtualenv

.\Scripts\activate (Windows users)

or

source djangomaps/bin/activate (mac users)

  • This will install all the neccessary packages.

pip install -r requirements.txt

  • After its done, cd into src/maps, open views.py and put the access token within the quotes. Go ahead and run the application.
python manage.py runserver
  • Go to localhost

local

Detailed instructions

Usage

views.py

def default_maps(request):
	# TODO: move Token to settings.py file
	mapbox_access_token = 'PUT TOKEN HERE.'
	
	return render(request, 'details.html', {'mapbox_access_token':mapbox_access_token})

3dmapsdjango's People

Contributors

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