Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2012

    Conflict Nokia Maps and Mootools


    Can any one find a solution for conflict with Motools ?

    The map is showen but only like a printscreen(without fonctionnalities ..) when i survol it i have this error message:

    Uncaught TypeError: Cannot read property 'indexOf' of undefined file.js:1612
    Uncaught TypeError: Object #<MouseEvent> has no method 'clone' map-js-p2d-canvas.js:42

    Thank you

    Best regards

  2. #2
    Regular Contributor
    Join Date
    Aug 2011

    Re: Conflict Nokia Maps and Mootools

    Yes there is a conflict, it is to do with both libraries overriding the clone function for arrays. Unfortunately this is vital for the Nokia Maps event system so the result is a static map (and a load of JavaScript errors.) I'm not sure if it helps, but I can get the map to react to events by removing five lines from the mootools-core-1.4.5-full-compat.js library instead.

    Firstly ensure the Nokia Maps library loads first by declaring it first i.e.:

    <html xmlns="http://www.w3.org/1999/xhtml">
    		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    		<meta http-equiv="X-UA-Compatible" content="IE=7; IE=EmulateIE9" />
    		<title>Premiership: Nokia Maps with Mootools</title>
    		<script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.3/jsl.js?with=all"></script>
    		<script type="text/javascript" src="mootools-core-1.4.5-full-compat.js"></script>
    Secondly comment out the following in the mootools-core-1.4.5-full-compat.js file:

    Array.implement('clone', function(){
    	var i = this.length, clone = new Array(i);
    	while (i--) clone[i] = cloneOf(this[i]);
    	return clone;
    The map will then work, I'm not sure of the effect on the Mootools codebase since this means the system is using the Nokia Maps version instead.

  3. #3
    Registered User
    Join Date
    Dec 2012

    Re: Conflict Nokia Maps and Mootools

    I encountered the same problem while trying out the Maps API and gave your suggested solution a shot, but Mootools broke really bad with its clone implementation gone. I'm not really going to switch out Mootools for this so it sadly means the Maps API is useless to me until it's fixed. And I do think it should be fixed in the Maps API — a general purpose library like Mootools is the only one I'd like to have fiddling around with standard library objects.

Similar Threads

  1. how can i, create a nokia.maps.map.Polyline using a nokia.maps.routing.Manager?
    By upixsoul in forum [Archived] Maps API for Javascript
    Replies: 5
    Last Post: 2012-05-30, 15:54
  2. Is there a way to convert Maps Data from Nokia Maps 3 to be compatible with N Maps 2
    By dimchopicha in forum General Development Questions
    Replies: 6
    Last Post: 2011-01-09, 18:50
  3. Navigation route coordinates from Nokia Maps or Ovi Maps
    By selimsolmaz in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-03-04, 11:02
  4. Replies: 3
    Last Post: 2010-03-03, 11:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts