Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68399

Bug on showing marker in map

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.2
    • Fix Version/s: None
    • Component/s: Administration, General
    • Labels:

      Description

      The position of the marker in the map is displaced.

      fixed by applying this patch:

      // diff --git a/iplookup/index.php b/iplookup/index.php
      index c285ee79169..96d0926b1ab 100644
      --- a/iplookup/index.php
      +++ b/iplookup/index.php
      @@ -84,13 +84,14 @@ if (empty($CFG->googlemapkey3)) {
           $dotwidth  = 18;
           $dotheight = 30;
       
      -    $dx = round((($info['longitude'] + 180) * ($imgwidth / 360)) - $imgwidth - $dotwidth/2);
      -    $dy = round((($info['latitude'] + 90) * ($imgheight / 180)));
      +    $dx = round((($info['longitude'] + 180 ) * ($imgwidth / 360)) - $imgwidth - $dotwidth/2);
      +    $dy = round((($info['latitude'] ) * ($imgheight / 90)) + $dotheight);
       
      -    echo '<div id="map" style="width:'.($imgwidth+$dotwidth).'px; height:'.$imgheight.'px;">';
      +    echo '<div id="map" style="width:'.$imgwidth.'px; height:'.$imgheight.'px;">';
           echo '<img src="earth.jpeg" style="width:'.$imgwidth.'px; height:'.$imgheight.'px" alt="" />';
      -    echo '<img src="marker.gif" style="width:'.$dotwidth.'px; height:'.$dotheight.'px; margin-left:'.$dx.'px; margin-bottom:'.$dy.'px;" alt="" />';
      +    echo '<img src="marker.gif" style="width:'.$dotwidth.'px; height:'.$dotheight.'px; margin-left:'.$dx.'px; margin-bottom:'.$dy.'px;" alt="'. $info['latitude'] . ', ' . $info['longitude'] .'" />';
           echo '</div>';
      +    echo '<div id="details">'. $info['latitude'] . ', ' . $info['longitude'] .'</div>';
           echo '<div id="note">'.$info['note'].'</div>';
       
       } else {
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              meirm Meir Michanie
              Peer reviewer:
              Simey Lameze
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h