iOS Development

javascript – is there any resolution for id adp-summary and adp-text overlapping difficulty in directionsDisplay in map

Spread the love


The issue is supply tackle getting overlapping with time element in dialog i.e i’ll open map in my software in getDirection button is there when i click on on that it’s going to open the dialog with choose possibility, there i’ll choose one firm it would show the route particulars from supply tackle to vacation spot tackle with full particulars (like flip left go straight take proper) however i get the overlapping difficulty on supply tackle with time particulars

I attempted the under code, to repair the problem

directionsService.route(request, operate (response, standing) {
   if (standing == google.maps.DirectionsStatus.OK) {
          const container = doc.getElementById("distance_info");              
          const observer = new MutationObserver(operate() {
               adjustSummaryPosition();
          });
          const config = { attributes: true, characterData: true };                
          observer.observe(container, config);
            
          directionsDisplay.setPanel(container);
          directionsDisplay.setDirections(response); 
            
          $("#outcomes").present();
    } else {
          $("#outcomes").disguise();
   }
});

operate adjustSummaryPosition() {
    const adpText = doc.querySelector('.adp-text');
    const adpSummary = doc.querySelector('.adp-summary');
    const adpLegal = doc.querySelector('.adp-legal');
    if (adpText && adpSummary) {
        const adpTextHeight = adpText.offsetHeight ;
        const adpTextMarginTop = parseInt(window.getComputedStyle(adpText).marginTop);
        adpSummary.type.marginTop = adpTextHeight - 20 +  'px';
        adpLegal.type.marginTop = adpTextHeight - 45 + 'px';
    } else {
        console.log("adpText or adpSummary aspect not discovered.");
    }
}

i attempted through the use of the css to repair the overlapping difficulty however nonetheless its not mounted as a result of the supply tackle will differ in line with the latitude and longitude

Leave a Reply

Your email address will not be published. Required fields are marked *