Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Jan 30, 2019
1 parent b345798 commit 14e6bce
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/current
2 changes: 1 addition & 1 deletion dist/pkg-agosms.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="component" version="3.5" method="upgrade">
<name>com_agosms</name>
<author>Astrid Günther</author>
<creationDate>2019-01-23</creationDate>
<creationDate>2019-01-30</creationDate>
<copyright>(C) 2019 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later;</license>
<authorEmail>info@astrid-guenther.de</authorEmail>
<authorUrl>www.astrid-guenther.de</authorUrl>
<version>1.0.28</version>
<version>1.0.29</version>
<description>COM_AGOSMS_XML_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>

Expand Down
Binary file modified dist/zips/com_agosms.zip
Binary file not shown.
Binary file modified dist/zips/mod_agosm.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion jorobo.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extension = agosms
version = 1.0.28
version = 1.0.29
source = src
target = package

Expand Down
11 changes: 6 additions & 5 deletions src/media/mod_agosm/js/LeafletControlRoutingtoaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ L.LeafletControlRoutingtoaddress = L.Control.extend({
var json_obj_route;
if (this.options.router === 'mapbox')
{
json_obj_route = JSON.parse(Get('https://api.mapbox.com/directions/v5/mapbox/cycling/' +
json_obj_route = JSON.parse(Get('https://api.mapbox.com/directions/v5/mapbox/driving/' +
json_obj_target[0].lon +
',' +
json_obj_target[0].lat +
Expand All @@ -111,18 +111,19 @@ L.LeafletControlRoutingtoaddress = L.Control.extend({

if (json_obj_route.message === 'Too Many Requests' || json_obj_route.message === 'Not Authorized - Invalid Token')
{
this._messagebox.innerHTML = this.options.requesterror + '( ' + this.options.router +' )';
this._messagebox.innerHTML = this.options.requesterror;
}
else if (typeof json_obj_route.routes[0] === 'undefined' ) {
this._messagebox.innerHTML = this.options.errormessage + '( ' + this.options.router +' )';
else if (typeof json_obj_route.routes[0] === 'undefined' )
{
this._messagebox.innerHTML = this.options.errormessage + '( ' + this.options.router +' )';
}
else
{
this._route_linestring = L.geoJSON(json_obj_route.routes[0].geometry).addTo(this._map);
var distance = (json_obj_route.routes[0].legs[0].distance)/1000;
var duration = (json_obj_route.routes[0].legs[0].duration)/60;
this._map.fitBounds(this._route_linestring.getBounds());
this._messagebox.innerHTML = this.options.distance + ' ' + distance.toFixed(2) + ' km, ' + this.options.duration + ' ' + duration.toFixed(2) + ' min. ' + '( ' + this.options.router +' )';
this._messagebox.innerHTML = this.options.distance + ' ' + distance.toFixed(2) + ' km, ' + this.options.duration + ' ' + (duration/60).toFixed(2) + ' h. ' + '( ' + this.options.router +' )';
}

}
Expand Down
6 changes: 3 additions & 3 deletions src/modules/mod_agosm/mod_agosm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@
<field
type="list"
name="routing_simple_router"
default="0"
default="osrm"
label="MOD_AGOSM_CONFIG_CONTROL_SHOWROUTING_ROUTER_LABEL"
description="MOD_AGOSM_CONFIG_CONTROL_SHOWROUTING_ROUTER_DESC"
showon="showrouting_simple:1"
>
<option value="1">mapbox</option>
<option value="0">osrm</option>
<option value="mapbox">mapbox</option>
<option value="osrm">osrm</option>
</field>

<field
Expand Down

0 comments on commit 14e6bce

Please sign in to comment.