Why MapQuest.js?

10 posts / 0 new
Last post
Why MapQuest.js?

1st the JavaScript SDK v7 is deprecated, then we are supposed to use Leaflet Plugins and now we're back to MapQuest.js. 

Is MapQuest.js going to replace the Leaflet Plugins?

RE: Why MapQuest.js?
The new MapQuest.js project is built around the Leaflet SDK.  Rather than having multiple plug-ins to load and the Leaflet SDK (and multiple versions of each), MapQuest.js is a single source file that will include all the MapQuest API functionality (map/route/geocode/search ahead/search) and it will load the supported version of the Leaflet SDK for you, too. The beta is being performed in stages.  We are adding new API features as the beta continues.

Beta Period and retiring of JavaScript SDK v7

Will the MapQuest.js be out of beta before the retiring of the JavaScript SDK v7 in 06/2018?

I wouldn't want to refactor for the Leaflet SDK now and then have to refactor later for the MapQuest.js API.

Yes, MapQuest.js will be
Yes, MapQuest.js will be officially released later this year - well ahead of the retirement of the JavaScript sdk v7

Migration from V7 to MapQuest.js api

I have a legacy application which uses  MQ.IO.doJSONP, MQ.withModule('route', 'routeio', <function()>)  &  MQA.Route.RouteDelegate()   v7 sdk apis. What is the equivalent  to handle these apis in MapQuest.js ?.

MapQuest.js has routing
MapQuest.js has routing functions built into it already. There are several examples, simple to customized, in the user guide here.

Thanks for the route details.

Thanks for the route details. Is there any MQ.IO.doJSONP equivalent or suggestions to handle it.

I don't know that Leaflet has
I don't know that Leaflet has its own json requester, but I use either jquery ajax or this overly simple function. function sendjson(request) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = request; document.body.appendChild(script); }

We used the code below which

We used the code below which gets called automatically by the v7 apis.  In new apis' I don't see how this can be achieved.  Thanks in advance.

MQA.IO.doJSONP = function(url,ioSettings) {

                    var scriptTag = document.createElement('script');

                    scriptTag.src = url;

                    scriptTag.type = 'text/javascript';


        return function() {};



Also for the route we used code like this and _customize poi function is called.  How this can be achieved in new api's.   Thanks you so much.

MQ.withModule('route', 'routeio', function() {

_this._mqRouteIo = new MQA.RouteIO(MQROUTEURL,true);

_this._mqRouteDelegate = new MQA.Route.RouteDelegate();

_this._mqRouteDelegate.customizePoi = function(poi) {

_this._onCustomizePoi.call(_this, poi);




The new sdk does not have an
The new sdk does not have an exposed utility function for sending a json request. The previously mentioned methods should work though.   Custom markers can be used in the route using this sample from the user guide.