{% extends "pylucid/css_anchor_div.html" %}

{% block plugin_content %}
{% extrahead %}
<!-- OpenStreetMap.html extrahead START -->
<script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js" onerror="JavaScript:alert('Error loading file:\n\nhttp://www.openlayers.org/api/OpenLayers.js');"></script>
<script type="text/javascript" src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js" onerror="JavaScript:alert('Error loading file:\n\nhttp://www.openstreetmap.org/openlayers/OpenStreetMap.js');"></script>
<script type="text/javascript" src="{{ PyLucid_media_url }}OpenStreetMap.js" onerror="JavaScript:alert('Error loading file:\n\n{{ PyLucid_media_url }}OpenStreetMap.js');" ></script>
<!-- OpenStreetMap.html extrahead END -->
{% endextrahead %}
<div id="map_container">
    <div id="map_{{ map.name }}" class="{{ map.name }}" style="width: {{ map.width }}px; height: {{ map.height }}px;">
    <noscript><h2>JavaScript is needed!</h2></noscript>
    </div>
    {% if perms.OpenStreetMap.change_mapentry %}
    <div class="admin_links">
        <a href="{% url admin:OpenStreetMap_mapentry_change map.id %}" title="{% trans 'edit in django admin site' %}" class="add_openinwindow">{% trans 'edit this map entry' %}</a>
    </div>
    {% endif %}
    <a href="http://www.openstreetmap.org/?lat={{ map.lat }}&lon={{ map.lon }}&zoom={{ map.zoom }}" id="osm" class="add_openinwindow">www.openstreetmap.org</a>
    <script type="text/javascript">drawmap("map_{{ map.name }}", "{{ lang_code }}", "{{ map.get_html }}", {{ map.lon }}, {{ map.lat }}, {{ map.zoom }}, {{ map.marker_lon }}, {{ map.marker_lat }}, {{ map.marker_width }}, {{ map.marker_height }});</script>
</div>
{% endblock %}