I have successfully generated a map using the Ionic 3 framework, but I encountered a runtime error when attempting to use the L.mapquest.directions().route()
function.
Here are the imports:
<link rel="stylesheet" href="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a767f7b7c767f6e5a2b342d342b">[email protected]</a>/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f9959c989f959c8db9c8d7ced7c8">[email protected]</a>/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest-core.js"></script>
<link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest-core.css"/>
Here is the code snippet causing the issue:
L.mapquest.key = MapQuestKey;
this.map = L.mapquest.map('map', {
center: [lat, lng],
layers: L.mapquest.tileLayer('map'),
zoom: 13
});
L.mapquest.directions().route({
start: '350 5th Ave, New York, NY 10118',
end: 'One Liberty Plaza, New York, NY 10006',
});
The error message I received is as follows:
ERROR Error: Uncaught (in promise):
TypeError: this._rawPxBounds is undefined _updateBounds@https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfa3aaaea9a3aabb8ffee1f8e1fe">[email protected]</a>/dist/leaflet.js:5:79584
setStyle@https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="08646d696e646d7c4839263f2639">[email protected]</a>/dist/leaflet.js:5:75174
setPathStyle@https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest-core.js:6:161888
updateRibbonWidth@https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest-core.js:6:163063
As a newcomer to Mapquest, I am unsure about the cause of this issue. Any suggestions or solutions would be greatly appreciated.