mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix Google maps lat/lon query string (#10463)
* Fix Google maps lat/lon query string Using , as latitude and longitude separate makes Google maps DTRT * Just comma
This commit is contained in:
committed by
Tony Murray
parent
1de640c3aa
commit
5400a908f3
@@ -127,7 +127,7 @@ if ($device['location_id']) {
|
||||
|
||||
echo '<button type="button" id="toggle-map-button" class="btn btn-primary btn-xs" data-toggle="collapse" data-target="#toggle-map"><i class="fa fa-map" style="color:white" aria-hidden="true"></i> <span>View</span></button>';
|
||||
if ($location_valid) {
|
||||
echo ' <a id="map-it-button" href="https://maps.google.com/?q=' . $location->lat . '+' . $location->lng . '" target="_blank" class="btn btn-success btn-xs" role="button"><i class="fa fa-map-marker" style="color:white" aria-hidden="true"></i> Map</a>';
|
||||
echo ' <a id="map-it-button" href="https://maps.google.com/?q=' . $location->lat . ',' . $location->lng . '" target="_blank" class="btn btn-success btn-xs" role="button"><i class="fa fa-map-marker" style="color:white" aria-hidden="true"></i> Map</a>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>
|
||||
@@ -151,7 +151,7 @@ if ($device['location_id']) {
|
||||
update_location(' . $location->id . ', new_location, function(success) {
|
||||
if (success) {
|
||||
$("#coordinates-text").text(new_location.lat.toFixed(5) + ", " + new_location.lng.toFixed(5));
|
||||
$("#map-it-button").attr("href", "https://maps.google.com/?q=" + new_location.lat + "+" + new_location.lng );
|
||||
$("#map-it-button").attr("href", "https://maps.google.com/?q=" + new_location.lat + "," + new_location.lng );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user