123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <div id="map" class="leaflet-map-widget"></div>
- <style type="text/css">
- .leaflet-map-widget {
- height: 400px;
- border: 1px solid #CCCCCC;
- }
- .leaflet-control-search.search-exp.leaflet-control {
- width: 400px !important;
- }
- .search-input {
- width: 370px !important;
- }
- </style>
- {% include 'LeafletBundle:Leaflet:resources.html.twig' %}
- {% if object is defined %}
- <script type="text/javascript">
- {% if object.location.extraData is defined %}
- var dataValue = '{{ object.location.extraData|raw }}';
- {% elseif object.extraData is defined %}
- var dataValue = '{{ object.extraData|raw }}';
- {% endif %}
- </script>
- {% endif %}
- <script type="application/javascript">
- var _MAP_LATITUDE = 0;
- var _MAP_LONGITUDE = 0;
- {% if config_manager is defined %}
- _MAP_LATITUDE = {{ config_manager.getValue('location', 'location', 'latitude')|default(0) }};
- _MAP_LONGITUDE = {{ config_manager.getValue('location', 'location', 'longitude')|default(0) }};
- {% else %}
- function setCoordinatesFromConfig(drawMapNow) {
- try {
- $.ajax({
- url: "{{ path('admin_config_manager_global_ajax') }}",
- type: 'POST',
- // async: true,
- data: {
- category: "location",
- setting: "location"
- }
- }).done(function (data) {
- if (data.result && data.config != null) {
- _MAP_LATITUDE = data.config.latitude;
- _MAP_LONGITUDE = data.config.longitude;
- if (drawMapNow) {
- drawMap(_MAP_LATITUDE, _MAP_LONGITUDE);
- }
- }
- });
- } catch (e) {
- _MAP_LATITUDE = 0;
- _MAP_LONGITUDE = 0;
- }
- }
- setCoordinatesFromConfig();
- {% endif %}
- </script>
- <script src="{{ asset('bundles/leaflet/js/leaflet-map.js') }}"></script>
- {% if draw is defined %}
- <script src="{{ asset('bundles/leaflet/js/leaflet-map-draw.js') }}"></script>
- {% endif %}
- {% if extra_js is defined %}
- <script src="{{ script_google_maps }}"></script>
- <script src="{{ asset('bundles/leaflet/js/leaflet-map-widget.js') }}"></script>
- {% endif %}
|