All Projects → silentsokolov → django-treasuremap

silentsokolov / django-treasuremap

Licence: MIT license
django-treasuremap app, makes it easy to store and display the location on the map using different providers (Google, Yandex).

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to django-treasuremap

Pizza Delivery
university project : Android pizza delivery app
Stars: ✭ 32 (+52.38%)
Mutual labels:  google-maps, location
Leku
🌍 Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker.
Stars: ✭ 612 (+2814.29%)
Mutual labels:  google-maps, location
activeadmin-latlng
Active Admin plugin for setting up latitude and longitude
Stars: ✭ 34 (+61.9%)
Mutual labels:  google-maps, yandex-maps
svelte-mapbox
MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
Stars: ✭ 267 (+1171.43%)
Mutual labels:  google-maps, location
Placepicker
Free Android Map Place Picker alternative using Geocoder instead of Google APIs
Stars: ✭ 126 (+500%)
Mutual labels:  google-maps, location
Hrcarmarkeranimation
This android library is helpful for google map marker animation with Smooth turn and movement.
Stars: ✭ 52 (+147.62%)
Mutual labels:  google-maps, location
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (+576.19%)
Mutual labels:  google-maps, location
Mapdrawingtools
this library Drawing polygon, polyline and points in Google Map and return coordinates to your App
Stars: ✭ 122 (+480.95%)
Mutual labels:  google-maps, location
Track Ip
Advanced Ip Tracker Tool
Stars: ✭ 150 (+614.29%)
Mutual labels:  google-maps, location
CarAnimation
A project for the implementation of the car animation feature in most ride-sharing/ food delivery apps
Stars: ✭ 45 (+114.29%)
Mutual labels:  google-maps, location
flutter google maps
A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
Stars: ✭ 86 (+309.52%)
Mutual labels:  google-maps
location-api-sl
This API can be use to all developers to get location details of Sri Lanka 🇱🇰 including major cities, sub areas, districts and Provinces. ⛳️
Stars: ✭ 35 (+66.67%)
Mutual labels:  location
ember-cli-g-maps
Deprecated Google Maps Addon
Stars: ✭ 58 (+176.19%)
Mutual labels:  google-maps
EasyLocationFetch
Easily fetch locations
Stars: ✭ 23 (+9.52%)
Mutual labels:  location
pinpoint
🌎 A python script for finding your Mac.
Stars: ✭ 56 (+166.67%)
Mutual labels:  location
quickstart-ios
Quickstart app for HyperTrack iOS SDK
Stars: ✭ 16 (-23.81%)
Mutual labels:  location
Atlas
🌎 Atlas is a set of APIs for looking up information about locations
Stars: ✭ 21 (+0%)
Mutual labels:  location
chowist
Great places are chosen by great chowists
Stars: ✭ 13 (-38.1%)
Mutual labels:  google-maps
GeoLite2-Country
GeoLite2-Country.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 69 (+228.57%)
Mutual labels:  location
Google-Maps-BottomSheet
A BottomSheetBehavior framework mirroring Google Maps'
Stars: ✭ 75 (+257.14%)
Mutual labels:  google-maps
https://github.com/silentsokolov/django-treasuremap/workflows/build/badge.svg?branch=master

django-treasuremap

django-treasuremap app, makes it easy to store and display the location on the map using different providers (Google, Yandex, etc).

Requirements

  • Python 2.7+ or Python 3.4+
  • Django 1.11+

Installation

Use your favorite Python package manager to install the app from PyPI, e.g.

Example:

pip install django-treasuremap

Add treasuremap to INSTALLED_APPS:

Example:

INSTALLED_APPS = (
    ...
    'treasuremap',
    ...
)

Configuration

Within your settings.py, you’ll need to add a setting (which backend to use, etc).

Example:

TREASURE_MAP = {
    'BACKEND': 'treasuremap.backends.google.GoogleMapBackend',
    'API_KEY': 'Your API key',
    'SIZE': (400, 600),
    'MAP_OPTIONS': {
        'zoom': 5
    }
}

Example usage

In models

from django.db import models
from treasuremap.fields import LatLongField

class Post(models.Model):
    name = models.CharField(max_length=100)
    point = LatLongField(blank=True)

In admin

from django.contrib import admin
from treasuremap.widgets import AdminMapWidget

from .models import Post

@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
    def formfield_for_dbfield(self, db_field, **kwargs):
        if db_field.name == 'point':
            kwargs['widget'] = widgets.AdminMapWidget()
        return super(PostAdmin,self).formfield_for_dbfield(db_field,**kwargs)

In forms

from django import forms
from treasuremap.forms import LatLongField

class PostForm(models.Model):
    point = LatLongField()
<head>
    ...
    <!-- jQuery is required; include if need -->
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    ...
</head>

<form method="POST" action=".">
    {{ form.media }}
    {% csrf_token %}
    {{ form.as_p }}
</form>

Depending on what backend you are using, the correct widget will be displayed with a marker at the currently position (jQuery is required).

https://raw.githubusercontent.com/silentsokolov/django-treasuremap/master/docs/images/screenshot.png

Settings

Support map:

  • Google map treasuremap.backends.google.GoogleMapBackend
  • Yandex map treasuremap.backends.yandex.YandexMapBackend

Other settings:

  • API_KEY - if need, default None
  • SIZE - tuple with the size of the map, default (400, 400)
  • ONLY_MAP - hide field lat/long, default True
  • MAP_OPTIONS - dict, used to initialize the map, default {'latitude': 51.562519, 'longitude': -1.603156, 'zoom': 5}. latitude and longitude is required, do not use other "LatLong Object".
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].