https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/gis/admin/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/gis/admin/__pycache__/widgets.cpython-310.pyc
o

���_p�@sfddlZddlmZddlmZmZddlmZddlm	Z	de	�
�iZe�d�Z
Gdd	�d	e�ZdS)
�N)�
GDALException)�
GEOSException�GEOSGeometry)�Textarea)�translation�
LANGUAGE_BIDIzdjango.contrib.gisc@s eZdZdZdd�Zdd�ZdS)�OpenLayersWidgetzA
    Render an OpenLayers map using the WKT of the geometry.
    c	
Csv|r|j�|�|jd|jd<nd|jd<d|jd<|rFt|t�rFzt|�}WnttfyE}zt�d||�d}WYd}~nd}~ww|rW|j	�
�|j	krW|j	dkrWd}|��|jd<||jd	<|jd	�d
d�}d||jd
<|r�|jd}|j
|kr�z
|j}|�|�|j}Wn ty�}zt�d|j
||�d}WYd}~nd}~ww|j}||jd<|j�t�|jS)N�
modifiable�editableT��wktz,Error creating geometry from value '%s' (%s)�GEOMETRY�map_options�name�-�_zgeodjango_%s�module�sridz<Error transforming geometry from srid '%s' to srid '%s' (%s))�params�update�
isinstance�strrr�
ValueError�logger�error�	geom_type�upperr�replacer�ogr�	transformrr�geo_context)	�selfr�value�attrs�err�js_safe_namerrr�r&�B/usr/lib/python3/dist-packages/django/contrib/gis/admin/widgets.py�get_contextsN

��





���
zOpenLayersWidget.get_contextc	
Cs�dd�}dd�}ddddtfdd	tfd
ddtfd
dtfddtfg}i}|D]C\}}}|j�|d�rh|dkr=||j|�}n'|dkrI||j|�}n|ttfvrU|j|}n|tfvrbd|j|}nt�|||<q%|S)z7Build the map options hash for the OpenLayers template.cS�d|S)Nznew OpenLayers.Bounds(%s)r&)�extentr&r&r'�	ol_boundsT�z/OpenLayersWidget.map_options.<locals>.ol_boundscSr))Nz$new OpenLayers.Projection("EPSG:%s")r&)rr&r&r'�
ol_projectionWr,z3OpenLayersWidget.map_options.<locals>.ol_projection)r�
projectionr)�display_srid�displayProjectionr�units�max_resolution�
maxResolution)�
max_extent�	maxExtent�bounds�num_zoom�
numZoomLevels�max_zoom�
maxZoomLevels�min_zoom�minZoomLevelFrr6z"%s")r�float�intr�get�	TypeError)	r!r+r-�	map_typesr�
param_name�js_name�option_typer"r&r&r'rQs4�
�zOpenLayersWidget.map_optionsN)�__name__�
__module__�__qualname__�__doc__r(rr&r&r&r'rs?r)�logging�django.contrib.gis.gdalr�django.contrib.gis.geosrr�django.forms.widgetsr�django.utilsr�get_language_bidir �	getLoggerrrr&r&r&r'�<module>s


https://t.me/RX1948 - 2025