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