Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function reInitMap(){
- address = "";
- if($("#Apartment_customCity").is(":visible") && $("#Apartment_customCity").length){
- address += addAddressString($("#ap_country option:selected").html());
- address += addAddressString($("#Apartment_customCity").val());
- }
- else {
- if($("#Apartment_city_id").length){
- address += addAddressString($("#Apartment_city_id option:selected").html());
- } else {
- address += addAddressString($("#ap_country option:selected").html());
- var region = addAddressString($("#ap_region option:selected").html());
- var area = addAddressString($("#ap_area option:selected").html());
- var city = addAddressString($("#ap_city option:selected").html());
- if (region !== city) {
- address += region;
- }
- if (area !== city && area !== region) {
- address += area;
- }
- address += city;
- }
- }
- if ($("#id_Apartmentaddress_"+lang).val()) {
- address += addAddressString($("#id_Apartmentaddress_"+lang).val());
- }
- else if ($("input[name=\'Apartment[address_"+lang+"]\']").val()) {
- address += addAddressString($("input[name=\'Apartment[address_"+lang+"]\']").val());
- }
- $("#address_for_map").val(address);
- // place code to end of queue
- if(useGoogleMap){
- setTimeout(function(){
- var tmpGmapCenter = mapGMap.getCenter();
- google.maps.event.trigger($("#googleMap")[0], "resize");
- mapGMap.setCenter(tmpGmapCenter);
- }, 0);
- }
- if(useYandexMap){
- setTimeout(function(){
- ymaps.ready(function () {
- globalYMap.container.fitToViewport();
- globalYMap.setCenter(globalYMap.getCenter());
- });
- }, 0);
- }
- if(useOSMap){
- setTimeout(function(){
- L.Util.requestAnimFrame(mapOSMap.invalidateSize,mapOSMap,!1,mapOSMap._container);
- }, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement