Routing is not working with geocodes from Brazil

5 posts / 0 new
Last post
jack.h
Routing is not working with geocodes from Brazil

Hello,

I have an aplication with the Routing Plugin for Leaflet, and it is not rendering the routes on the map anymore. This start to happen today.

I debugued and I figure out that the problem maybe is the country. The CODE 1 works fine, but the CODE 2 is not working. The only diferences between the two codes are de coordinates, as you can see bellow. What is the problem?

Best regards,

Jack

CODE 1 (WORKING):

<html>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" />

        <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.js"></script>
        <script src="https://www.mapquestapi.com/sdk/leaflet/v2.s/mq-map.js?key=KEY"></script>
        <script src="https://www.mapquestapi.com/sdk/leaflet/v2.s/mq-routing.js?key=KEY"></script>

        <script type="text/javascript">
            window.onload = function() {

                var map,
                    dir;

                map = L.map('map', {
                    layers: MQ.darkLayer(),
                    center: [ 42.346353, -71.415958 ],
                    zoom: 9
                });

                dir = MQ.routing.directions();

                dir.route({
                    locations: [
                        { latLng: { lat: 42.346797, lng: -71.547966 }},
                        { latLng: { lat: 42.360082, lng: -71.05888 }}
                    ]
                });

                map.addLayer(MQ.routing.routeLayer({
                    directions: dir,
                    fitBounds: true
                }));
            }
        </script>
    </head>

    <body style='border:0; margin: 0'>
        <div id='map' style='width:1100px; height:530px;'></div>
    </body>
</html>

CODE 2 (Not working)

<html>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" />

        <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.js"></script>
        <script src="https://www.mapquestapi.com/sdk/leaflet/v2.s/mq-map.js?key=KEY"></script>
        <script src="https://www.mapquestapi.com/sdk/leaflet/v2.s/mq-routing.js?key=KEY"></script>

        <script type="text/javascript">
            window.onload = function() {

                var map,
                    dir;

                map = L.map('map', {
                    layers: MQ.darkLayer(),
                    center: [ -23.561290, -46.656615 ],
                    zoom: 9
                });

                dir = MQ.routing.directions();

                dir.route({
                    locations: [
                          { latLng: { lat: -23.561290, lng: -46.656615 }},
                          { latLng: { lat: -23.586500, lng: -46.682033 }}
                    ]
                });

                map.addLayer(MQ.routing.routeLayer({
                    directions: dir,
                    fitBounds: true
                }));
            }
        </script>
    </head>

    <body style='border:0; margin: 0'>
        <div id='map' style='width:1100px; height:530px;'></div>
    </body>
</html>

 


MQBrianCoakley
This should be resolved with
This should be resolved with the next plugin update. This is currently scheduled for next week.

jack.h
Hello MQBrianCoakley,

Hello MQBrianCoakley,

Thanks for the answer. So, we are waiting for the next plugin to test.


jack.h
Hello MQBrianCoakley,

Hello MQBrianCoakley,

I just tested our application and it is working again. All the routes are ploted now.

It will be a new version of Leaflet? Newer than v2.1?

Thanks for the update.

 


MQBrianCoakley
The update was done to v2.1.
The update was done to v2.1. That is the latest version available.