Title: No map and JavaScript errors in console
Last modified: January 19, 2018

---

# No map and JavaScript errors in console

 *  [Dominik Kocuj](https://wordpress.org/support/users/domko/)
 * (@domko)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/no-map-and-javascript-errors-in-console/)
 * Hello.
 * On the website all maps are working so far. However, there was an attempt to 
   add map of Iraq and first time there are some strange problems. Map is not visible(
   only information “JS map by AmCharts” is visible). When I click left mouse button,
   I will have in the console the following JavaScript errors:
 *     ```
       Uncaught TypeError: Cannot read property 'getBBox' of undefined
           at b.zoomToStageXY (ammap.js?ver=1.1.6:20)
           at b.doDoubleClickZoom (ammap.js?ver=1.1.6:30)
           at b.handleReleaseOutside (ammap.js?ver=1.1.6:18)
           at HTMLDocument.d.handleMouseUp (ammap.js?ver=1.1.6:1)
       ```
   
 *     ```
       Uncaught TypeError: this.smallMap.update is not a function
           at b.updateSmallMap (ammap.js?ver=1.1.6:17)
           at b.handleMouseMove (ammap.js?ver=1.1.6:19)
           at b.handleDocTouchEnd (ammap.js?ver=1.1.6:5)
           at b.handleReleaseOutside (ammap.js?ver=1.1.6:5)
           at b.handleReleaseOutside (ammap.js?ver=1.1.6:17)
           at HTMLDocument.d.handleMouseUp (ammap.js?ver=1.1.6:1)
       ```
   
 * The first error is activated only once at the beggining, and the second one is
   always activated after clicking left mouse button.
 * It is strange why only this one map is not working. Can you help?
 * Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [martynasma](https://wordpress.org/support/users/martynasma/)
 * (@martynasma)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/no-map-and-javascript-errors-in-console/#post-9897236)
 * Hi Dominik.
 * This sounds like a missing map.
 * If you are sure the map file is loaded (in Resources tab) and there are no error
   in console telling loading of such map failed, check if your data correctly refers
   to the map in `dataProvider`.
 * If that doesn’t help, maybe you can provide a link to a page with your map so
   that I could check?
 *  Thread Starter [Dominik Kocuj](https://wordpress.org/support/users/domko/)
 * (@domko)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/no-map-and-javascript-errors-in-console/#post-9897347)
 * Thank you for your response.
 * In “resources” tab is the following text:
 *     ```
       //www.amcharts.com/lib/3/ammap.js
       //www.amcharts.com/lib/3/maps/js/iraqHigh.js
       ```
   
 * However, I’ve checked `dataProvider` in HTML source and it is incorrect. It has
   a map `worldLow` instead of `iraqHigh`. However, I don’t know how can I change
   it.
 * Furthermore, in post with this map, there is no JavaScript code for this, so 
   there is no `dataProvider`. The `dataProvider` (but with wrong value) with JavaScript
   code is only in map preview.
 * Please, if you know what is the problem, explain how should I add this map correctly.
   I think it is important to know that there are many maps on this website and 
   all of them are working correctly and this is first time when such problem exists.
 * If you’d like to see it live, the website with this damaged map is here: [http://www.kompas.travel.pl/kraje/irak-kurdystan/](http://www.kompas.travel.pl/kraje/irak-kurdystan/)
 * Thank you again.
 * EDIT:
    I’ve added the following code to tab `JavaScript`:
 *     ```
       var $CHART$ = AmCharts.makeChart( "$CHART$", {
         "type": "map",
         "dataProvider": {
           "map": "iraqHigh",
           "getAreasFromMap": true
         },
         "areasSettings": {
           "autoZoom": true,
           "selectedColor": "#CC0000"
         },
         "smallMap": {}
       } );
       ```
   
 * and it is working now. However, is it normal procedure to adding this code in
   all maps which will be created?
    -  This reply was modified 8 years, 4 months ago by [Dominik Kocuj](https://wordpress.org/support/users/domko/).
    -  This reply was modified 8 years, 4 months ago by [Dominik Kocuj](https://wordpress.org/support/users/domko/).
    -  This reply was modified 8 years, 4 months ago by [Dominik Kocuj](https://wordpress.org/support/users/domko/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘No map and JavaScript errors in console’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amcharts-charts-and-maps_6f74b0.svg)
 * [amCharts: Charts and Maps](https://wordpress.org/plugins/amcharts-charts-and-maps/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amcharts-charts-and-maps/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amcharts-charts-and-maps/)
 * [Active Topics](https://wordpress.org/support/plugin/amcharts-charts-and-maps/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amcharts-charts-and-maps/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amcharts-charts-and-maps/reviews/)

## Tags

 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 2 replies
 * 2 participants
 * Last reply from: [Dominik Kocuj](https://wordpress.org/support/users/domko/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/no-map-and-javascript-errors-in-console/#post-9897347)
 * Status: not resolved