*

rooman

  • ****
  • 223 posts
Hello
I have a problem with the edit item page
When you edit the location of the item directly from the map
And press send
A message appears
Select the location of the item from the Location entry item
Then the application is accepted
Is the problem in the OpenStreet plugin?
Or the problem is entering the site from Itempost
Thanks
The theme Epsilon
« Last Edit: March 24, 2024, 09:24:28 AM by rooman »

*

MB Themes

Most probably type of location selector does not work well with openstreetmaps that is not possible to define or find city/region
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 223 posts
Quote
$('input[name="regionId"], input[name="cityId"]').val('');
The problem is caused by this code
If it is disabled
The page works without problems
It could just be the city
Activated with the map upon selection

*

MB Themes

Can you put whole code block?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 223 posts
Code: [Select]
// FILL ADDRESS TO ALL POSSIBLE PLACES
function osmMarkerAddressBind(marker, data, lat = '', lon = '') {
  <?php if(osm_param('publish_map_search_version') < 2) { ?>
 
    if(data !== false) {
      $('input[name="d_coord_lat"]').val(data.lat);
      $('input[name="d_coord_long"]').val(data.lon);
      $('input[name="sCountry"], input[name="country"]').val(osmDef(data.address.country));
      $('input[name="countryId"]').val(osmDef(data.address.country_code));
      $('input[name="sRegion"], input[name="region"]').val(osmDef(data.address.state));
      $('input[name="sCity"], input[name="city"]').val(osmGetCity(data));
      $('input[name="cityArea"]').val(osmDef(data.address.city_district));
      $('input[name="zip"]').val(osmGetZip(data));
      $('input[name="address"]').val((osmDef(data.address.road) + ' ' + osmDef(data.address.house_number)).trim());
      $('input[name="term"]').val((osmGetCity(data)).trim() + ', ' + osmDef(data.address.state) + ', ' + osmDef(data.address.country_code).toUpperCase());
      $('input[name="regionId"], input[name="cityId"]').val('');


      // SET LOCATION VALUES TO CASCADING DROPDOWNS
      if($('select[name="countryId"]').length) {
        $('input[name="sCountry"], input[name="country"], input[name="countryId"]').val('').attr('disabled', true);
        $('select[name="countryId"] option[value=' + (osmDef(data.address.country_code).toUpperCase()) + ']').attr('selected','selected').change();
        $('select[name="countryId"]').parent().find('span:first-child').text($('select[name="countryId"]').find('option:selected').text());
      }

      setTimeout(function(){
        if($('select[name="regionId"]').length) {
          $('input[name="sRegion"], input[name="region"], input[name="regionId"]').val('').attr('disabled', true);
          $('select[name="regionId"] option:contains(' + osmDef(data.address.state) + ')').attr('selected','selected').change();
          $('select[name="regionId"]').parent().find('span:first-child').text($('select[name="regionId"]').find('option:selected').text());
        }
      }, 500);

      setTimeout(function(){
        if($('select[name="cityId"]').length) {
          $('input[name="sCity"], input[name="city"], input[name="cityId"]').val('').attr('disabled', true);
          $('select[name="cityId"] option:contains(' + osmGetCity(data) + ')').attr('selected','selected').change();
          $('select[name="cityId"]').parent().find('span:first-child').text($('select[name="cityId"]').find('option:selected').text());
        }
      }, 1200);
     
      marker.bindPopup('<div class="osm-address">' + osmDef(data.display_name) + '</div>').openPopup();
      $('input.term, input.term2').val(data.display_name);
    }
   
  <?php } else if(osm_param('publish_map_search_version') == 2) { ?>
    if(data.status == 'OK') {
      $('input[name="d_coord_lat"]').val(data.d_coord_lat);
      $('input[name="d_coord_long"]').val(data.d_coord_long);
   
      $('select[name="countryId"], input[name="sCountry"], input[name="country"], input[name="countryId"]').val(data.fk_c_country_code);
      $('select[name="regionId"], input[name="sRegion"], input[name="region"], input[name="regionId"]').val(data.fk_i_region_id);
      $('select[name="cityId"], input[name="sCity"], input[name="city"], input[name="cityId"]').val(data.fk_i_city_id);

      // SET LOCATION VALUES TO CASCADING DROPDOWNS
      if($('select[name="countryId"]').length) {
        $('input[name="sCountry"], input[name="country"], input[name="countryId"]').val('').attr('disabled', true);
        $('select[name="countryId"]').val(data.fk_c_country_code).change();
        $('select[name="countryId"]').parent().find('span:first-child').text($('select[name="countryId"]').find('option:selected').text());
      }

      setTimeout(function(){
        if($('select[name="regionId"]').length) {
          $('input[name="sRegion"], input[name="region"], input[name="regionId"]').val('').attr('disabled', true);
          $('select[name="regionId"]').val(data.fk_i_region_id).change();
          $('select[name="regionId"]').parent().find('span:first-child').text($('select[name="regionId"]').find('option:selected').text());
        }
      }, 500);

      setTimeout(function(){
        if($('select[name="cityId"]').length) {
          $('input[name="sCity"], input[name="city"], input[name="cityId"]').val('').attr('disabled', true);
          $('select[name="cityId"]').val(data.fk_i_city_id).change();
          $('select[name="cityId"]').parent().find('span:first-child').text($('select[name="cityId"]').find('option:selected').text());
        }
      }, 1000);
     
      //marker.bindPopup('<div class="osm-address">' + data.s_display_name + '</div>').openPopup();
      $('input.term, input.term2').val(data.s_display_name);
    } else {
      console.log(data);
    }
   
  <?php ?>
}
[/quote]
Can you put whole code block?

*

MB Themes

I see, thanks, I would just move that line right under
Code: [Select]
if(data !== false) {
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 223 posts
I see, thanks, I would just move that line right under
Code: [Select]
if(data !== false) {
Code: [Select]

      $('input[name="d_coord_lat"]').val(data.lat);
      $('input[name="d_coord_long"]').val(data.lon);
      $('input[name="sCountry"], input[name="country"]').val(osmDef(data.address.country));
      $('input[name="countryId"]').val(osmDef(data.address.country_code));
      $('input[name="sRegion"], input[name="region"]').val(osmDef(data.address.state));
      $('input[name="sCity"], input[name="city"]').val(osmGetCity(data));
      $('input[name="cityArea"]').val(osmDef(data.address.city_district));
      $('input[name="zip"]').val(osmGetZip(data));
      $('input[name="address"]').val((osmDef(data.address.road) + ' ' + osmDef(data.address.house_number)).trim());
      $('input[name="term"]').val((osmGetCity(data)).trim() + ', ' + osmDef(data.address.state) + ', ' + osmDef(data.address.country_code).toUpperCase());
      $('input[name="regionId"], input[name="cityId"]').val('');
     if(data !== false) {

      // SET LOCATION VALUES TO CASCADING DROPDOWNS
      if($('select[name="countryId"]').length) {
        $('input[name="sCountry"], input[name="country"], input[name="countryId"]').val('').attr('disabled', true);
        $('select[name="countryId"] option[value=' + (osmDef(data.address.country_code).toUpperCase()) + ']').attr('selected','selected').change();
        $('select[name="countryId"]').parent().find('span:first-child').text($('select[name="countryId"]').find('option:selected').text());
      }
Thank you.
Unfortunately, the transfer was completed and it did not work.
The problem remains

*

MB Themes

I've not said to move if condition :)
Just to move this block
Code: [Select]
$('input[name="regionId"], input[name="cityId"]').val('');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 223 posts
I've not said to move if condition :)
Just to move this block
Code: [Select]
$('input[name="regionId"], input[name="cityId"]').val('');
Move this line
Or marginalize him
The same problem
The map does not work with the location
Code: [Select]
//$('input[name="regionId"], input[name="cityId"]').val('');