mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fixed location
This commit is contained in:
parent
876a414b3b
commit
7ee217480e
@ -10,6 +10,11 @@
|
||||
aria-controls="nav-description"
|
||||
aria-selected="true">{{ trans('visiosoft.module.advs::field.description') }}</a>
|
||||
|
||||
<a class="nav-item nav-link bg-secondary text-white" id="nav-location-tab"
|
||||
data-toggle="tab" href="#nav-location" role="tab"
|
||||
aria-controls="nav-location"
|
||||
aria-selected="true">{{ trans('visiosoft.module.location::addon.title') }}</a>
|
||||
|
||||
<!-- Content Tab With Block -->
|
||||
{{ addBlock('ad-detail/content-tab',{'features':features})|raw }}
|
||||
<!-- Content Tab With Block -->
|
||||
@ -25,6 +30,12 @@
|
||||
<p>{{ adv.advs_desc|raw }}</p>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade show " id="nav-location" role="tabpanel"
|
||||
aria-labelledby="nav-description-tab">
|
||||
<h4>{{ trans('visiosoft.module.location::addon.title') }}</h4>
|
||||
{% include "visiosoft.module.advs::ad-detail/partials/map" %}
|
||||
</div>
|
||||
|
||||
<!-- Content With Block -->
|
||||
{{ addBlock('ad-detail/content',{'features':features,'adv':adv, 'profile': profile})|raw }}
|
||||
<!-- Content With Block -->
|
||||
|
||||
@ -1,29 +1,47 @@
|
||||
<p>
|
||||
{% if(adv.map_Val == "") %}
|
||||
{{ trans('visiosoft.module.advs::field.no_location') }}
|
||||
{{ trans('visiosoft.module.advs::field.no_location') }}
|
||||
{% else %}
|
||||
{% set map_arr = adv.map_Val|split(',') %}
|
||||
<div id="mapDiv" style="height: 500px; width: 100%; "></div>
|
||||
<script>
|
||||
var lat = parseFloat({{ map_arr[0] }});
|
||||
var lng = parseFloat({{ map_arr[1] }});
|
||||
var google_map_key = "{{ setting_value('visiosoft.module.location::google_map_key') }}";
|
||||
{% set map_arr = adv.map_Val|split(',') %}
|
||||
<div id="mapDiv" style="height: 500px; width: 100%; "></div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var no_image_text = "{{ trans('visiosoft.module.streetview::field.no_location') }}";
|
||||
|
||||
function initMap() {
|
||||
var myLatLng = {lat: lat, lng: lng};
|
||||
|
||||
var map = new google.maps.Map(document.getElementById('mapDiv'), {
|
||||
zoom: 16,
|
||||
center: myLatLng
|
||||
});
|
||||
new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
map: map
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap"
|
||||
type="text/javascript"></script>
|
||||
var ifAnyImg = "https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=" + coord[0] + "," + coord[1] +
|
||||
"&fov=90&heading=235&pitch=10&key=" + google_map_key;
|
||||
$.getJSON(ifAnyImg, function (data) {
|
||||
if (data.status === "OK") {
|
||||
loadScript('https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap');
|
||||
}
|
||||
if (data.status === "ZERO_RESULTS") {
|
||||
$("#mapDiv").html(no_image_text);
|
||||
} else {
|
||||
$("#mapDiv").html("Google Error : " + data.error_message);
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var lat = parseFloat({{ map_arr[0] }});
|
||||
var lng = parseFloat({{ map_arr[1] }});
|
||||
var google_map_key = "{{ setting_value('visiosoft.module.location::google_map_key') }}";
|
||||
|
||||
{% endif %}
|
||||
function initMap() {
|
||||
var myLatLng = {lat: lat, lng: lng};
|
||||
|
||||
var map = new google.maps.Map(document.getElementById('mapDiv'), {
|
||||
zoom: 16,
|
||||
center: myLatLng
|
||||
});
|
||||
new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
map: map
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
</p>
|
||||
Loading…
Reference in New Issue
Block a user