0
votes

I'm using leaflet routing machine with mapzen.
enter image description here
It works fine on browser but finding a problem when I run the project on a real device seems that it tries to call the mapzen service but to a wrong url.
This is a screenshot : enter image description here

this is the code I wrote

    $scope.map = L.map('roadMap');
  L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
  }).addTo($scope.map);
  $scope.control = L.Routing.control({
    waypoints : $scope.waypoints,
    router: L.Routing.valhalla('valhalla-0jUHQB0', 'bicycle'),
    formatter: new L.Routing.Valhalla.Formatter(),
    summaryTemplate:'<div class="start">{name}</div><div class="info {transitmode}">{distance}, {time}</div>',
    routeWhileDragging: true,
    geocoder: L.Control.Geocoder.nominatim()
  }).addTo($scope.map);

it must be a way for telling that the url should start with http:// I couldn't change that, the script is not finding valhalla.mapzen.com and nominatim.openstreetmap.com can anyone help.
thank you.

1

1 Answers

0
votes

I fixed the issue, I had to go into the lrm-valhalla.js and change the serviceUrl L.Routing.OSRM = L.Class.extend({ options: {
serviceUrl: 'http://valhalla.mapzen.com/...',//old serviceUrl: '//valhalla.mapzen.com/...'