4 posts / 0 new
Last post

I don't seem to be able to get the geocoder to work, any help would be appreciated - I suspect I'm missing something obvious.

I have

<script src=""></script>

in my index.html and am using


in my javascript (I'm using Angular 4). L.mapquest is defined, and I can see the map, but from what I can tell from the documentation there should be a geocoding function on the mapquest object. However, I get this console error:

TypeError: L.mapquest.geocoding is not a function

Does the geocoder have some other requirement?

Thanks in advance,


Assuming you also have the
Assuming you also have the css connected, it looks like you have everything you need. This should cover a simple version of what you need to do to geocode within MapQuest.js. Unless another script tag has overwritten the MapQuest.js tag, or parts of it, you should be good to go.

Geocoding with an Advanced Location Object

This is the code, in principle it worked perfect, and after trying to load the address with PHP it stopped working, even when you erase the code and put the address back by hand. What can be?

    <script src=""></script>
    <link type="text/css" rel="stylesheet" href=""/>

    <script type="text/javascript">
      window.onload = function() {
        L.mapquest.key = 'lYrP4vF3Uk5zgTiGGuEzQGwGIVDGuy24';

          street: '52 azul',
          city: 'Buenos Aires',
          state: '',
          postalCode: '1407'
        }, createMap);

        function createMap(error, response) {
          var location = response.results[0].locations[0];
          var latLng = location.displayLatLng;
          var map ='map', {
            center: latLng,
            layers: L.mapquest.tileLayer('map'),
            zoom: 18

  <body style="border: 0; margin: 0;">
    <div id="map" style="width: 100%; height: 530px;"></div>

What is the resulting html
What is the resulting html/javascript from the PHP that is not working? Is the address, html, javascript, or anything else different when coming from the PHP? I've done almost zero PHP so I won't be much, if any, help with that.