Skip to main content

Maps module for monocle

Project description

---
### Модуль: monocle_menu
---

Модуль для отображения каты на сайте. Позволяет отобразить как Yandex карты, так и Google карты.
Имеется множество настроек, такие как: зум, тип отображения карты, настройки метки и т.д.

## **Пример отображения на сайте:**
![Map](/images_readme/map.png)

## **Пример отображения в панели администрирования:**
![Map](/images_readme/map_admin.png)

## **Файл models.py:**

from django.db import models
from . import widgets

from solo.models import SingletonModel
from filebrowser.fields import FileBrowseField

CHOICES_TYPE_OF_MAP = (('YM', 'Яндекс Карта',), ('GM', 'Google Карта',))
CHOICES_TYPE_OF_DISPLAY = (('ROADMAP', 'Карта',), ('HYBRID', 'Спутник',))

class Map(SingletonModel):
name = models.CharField(blank=False, null=False, max_length=255, verbose_name='Заголовок')
map = widgets.LocationField(blank=False, null=False, verbose_name='Карта')
zoom = models.IntegerField(blank=False, null=False, default='14', verbose_name='Зум')
mapDisplayType = models.CharField(max_length=7, choices=CHOICES_TYPE_OF_DISPLAY, default='ROADMAP', verbose_name='Тип Отображения карты')
baloon = models.TextField(blank=True, verbose_name='Текст балуна')
markerImg = FileBrowseField(max_length=300, directory="'marker", extensions=[".jpg", ".png", ".jpeg", ".ico", ], blank=False, null=False, verbose_name='Картинка для метки')
mapType = models.CharField(max_length=2, choices=CHOICES_TYPE_OF_MAP, default='YM', verbose_name='Тип карты')

def __str__(self):
return self.name

class Meta:
verbose_name_plural = 'Карта'
verbose_name = 'Карта'

from django.apps import AppConfig
class CustomAppConfig(AppConfig):
name = 'apps.monocle_map'
verbose_name = 'Карта'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monocle_map-0.1.7.tar.gz (60.8 kB view details)

Uploaded Source

Built Distribution

monocle_map-0.1.7-py3-none-any.whl (65.2 kB view details)

Uploaded Python 3

File details

Details for the file monocle_map-0.1.7.tar.gz.

File metadata

  • Download URL: monocle_map-0.1.7.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for monocle_map-0.1.7.tar.gz
Algorithm Hash digest
SHA256 71acbec36c14b79d11bba887a0a6d051df588e39f0e404fa7b8fbe1d6d7b0f9c
MD5 fb39db75d2a72ca8b8caafd9b782f144
BLAKE2b-256 182ae6e744af913643ad5716528139086d455b217a7fb9d6b4b4918d6d26efbe

See more details on using hashes here.

File details

Details for the file monocle_map-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle_map-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 dee0a5433c4e1e19ac4a214c95906201d1a407c41702427cf7c82b7439695a97
MD5 ffdf2407ffd931937edbeaf5fa564529
BLAKE2b-256 ab3daab1e59de074fad201e01896bad42e6b5ab6e2164f384c4abac0465f4d32

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page