' + toshow_placename_str + '
';
});
}
predictionsDropDown.empty();
predictionsDropDown.append(predic_line_html);
predictionsDropDown.show();
});
//
predictionsDropDown.delegate('div', 'click', function () {
var predic_loc_val = jQuery(this).find('span').html();
jQuery('#jobsearch_lochiden_addr_59948391').val(predic_loc_val);
var map_center_coords = [];
var map_addrapi_uri = 'https://api.mapbox.com/geocoding/v5/mapbox.places/' + encodeURI(predic_loc_val) + '.json?access_token=pk.eyJ1Ijoid2VibGFuZHNjaGFmdCIsImEiOiJjbDB2NWY2c3UwMTExM2lwZ2dtMDIwN3VlIn0.HrpEMjkZJQE7CO9SZiTJtQ';
jobsearch_common_getJSON(map_addrapi_uri, function (new_loc_status, new_loc_response) {
if (typeof new_loc_response === 'object') {
map_center_coords = new_loc_response.features[0].geometry.coordinates;
if (map_center_coords !== 'undefined') {
map.flyTo({
center: map_center_coords,
});
}
}
if (map_center_coords.length > 1) {
var map_center_lng = map_center_coords[0];
var map_center_lat = map_center_coords[1];
document.getElementById("jobsearch_location_lat_59948391").value = map_center_lat;
document.getElementById("jobsearch_location_lng_59948391").value = map_center_lng;
// remove markers
if (currentMarkers !== null) {
for (var i = currentMarkers.length - 1; i >= 0; i--) {
currentMarkers[i].remove();
}
}
//
var new_marker = new mapboxgl.Marker({
draggable: true
}).setLngLat(map_center_coords).addTo(map);
currentMarkers.push(new_marker);
new_marker.on('dragend', function () {
var lngLat = new_marker.getLngLat();
document.getElementById("jobsearch_location_lat_59948391").value = lngLat.lat;
document.getElementById("jobsearch_location_lng_59948391").value = lngLat.lng;
});
}
});
predictionsDropDown.hide();
});
//
map.addControl(new mapboxgl.NavigationControl({
showCompass: false
}), 'top-right');
var marker = new mapboxgl.Marker({
draggable: true
}).setLngLat([-95.712891, 37.090240]).addTo(map);
currentMarkers.push(marker);
function onDragEnd59948391() {
var lngLat = marker.getLngLat();
document.getElementById("jobsearch_location_lat_59948391").value = lngLat.lat;
document.getElementById("jobsearch_location_lng_59948391").value = lngLat.lng;
}
marker.on('dragend', onDragEnd59948391);
function onZoomMap59948391(objZoom) {
if (typeof objZoom.target._easeOptions.zoom !== 'undefined') {
var getZoomLvel = objZoom.target._easeOptions.zoom;
document.getElementById("jobsearch_location_zoom_59948391").value = getZoomLvel;
}
}
map.on('zoom', onZoomMap59948391);
});
Mit dem aktivieren der Checkbox stimmen Sie unseren Geschäftsbedingungen und Datenschutzrichtlinien zu.