Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8360483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:28:40+00:00 2026-06-09T11:28:40+00:00

I have drawn a map in Inkscape, saved it as SVG and used http://readysetraphael.com/

  • 0

I have drawn a map in Inkscape, saved it as SVG and used http://readysetraphael.com/ to convert it to Raphial.
I put this generated code into a function called drawMap and I have saved this in js/map.js

js/map.js:

function drawMap(){
 var map = Raphael('map', '100mm', '100mm');
 var layer4 = map.set();
 var path3041 = map.path("m 106.15571,153.07817 -1.64315,13.74999 4.60661,10.36488 6.04618,9.21323 9.21323,3.16705 6.04618,6.04618 8.34949,8.06157 77.4487,1.72748 3.45496,-48.79108 z");
 path3041.attr({id: 'path3041',parent: 'layer4',opacity: '0.98999999',fill: '#ffb380',stroke: '#000000',"stroke-width": '3',"stroke-linecap": 'butt',"stroke-linejoin": 'miter',"stroke-miterlimit": '4',"stroke-opacity": '1',"stroke-dasharray": 'none'}).data('id', 'path3041');
 layer4.attr({'id': 'layer4','name': 'layer4'});

 //etc, more lines than stackoverflow will let me add

var mapGroups = [layer4,layer5,layer19,layer20,layer21,layer22,layer23,layer24,layer25,layer26,layer6,layer7,layer8,layer9,layer10,layer1,layer3,layer11,layer12,layer13,layer14,layer15,layer16,layer17,layer18,layer27,layer28,layer29,layer30,layer31,layer32,layer33,layer34,layer35,layer36,layer37,layer38,layer39,layer40,layer41,layer42,layer43,layer44,layer45];
}

I then put raphael-min.js and into the ‘js’ folder.

When I called drawMap() firebug said:

“drawMap is not defined”

I added the containts of map.js into the html file but I recived the error “Raphial is not defined”.

I assumed this was as raphial was being called before raphial-min.js had loaded so I used Modernizer to load raphial-min.js and map.ja before calling drawMap() but now I get the error:

“drawMap is not defined”

Index.html:

<!DOCTYPE html>
<html>
<head>
    <title>Risk</title>
    <script type="text/javascript" src="http://modernizr.com/downloads/modernizr.js"></script>
    </head>
    <body>
    <div id="map">
    <script type="text/javascript">
        drawMap()
        Modernizr.load({
            load: 'js/raphael-min.js',
            load: 'js/map.js',
            complete: drawMap()
        })
    </script>
    </div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:28:42+00:00Added an answer on June 9, 2026 at 11:28 am

    Several issues with the Modernizr implementation.

    1. In the complete property, you should not be calling drawMap, just referring to it and since it’s not loaded yet, you have to refer to it in an anonymous inline function.
    2. You should not be calling drawMap() before loading it.
    3. In the Modernizr.load() syntax, javascript doesn’t let you use multiple load properties on the same object.

    So this:

    drawMap();
    Modernizr.load({
        load: 'js/raphael-min.js',
        load: 'js/map.js',
        complete: drawMap()
    })
    

    should be this:

    Modernizr.load({
        load: ['js/raphael-min.js', 'js/map.js'],
        complete: function() {drawMap();}
    })
    

    Also, I don’t know why you’re dynamically loading these. It probably isn’t necessary. you could just do this:

    <script src="js/raphael-min.js"></script>
    <script src="js/map.js"></script>
    <script>
    drawMap();
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map drawn in SVG that I use matrix transformations to rotate
I have drawn something like this: How to remove the paths and points?
I have a MyCanvas class that extends JComponent. On this canvas I have drawn
I have a map drawn with OpenGLES, and I have a pan gesture recognizer
I have drawn circle using circle = new google.maps.Circle({ map: map, radius: r, //
I have a code that goes like this: jLabel.setIcon(map); Graphics2D g = (Graphics2D) jLabel.getGraphics();
I need to have a 2 radius map drawn off the player's current room
I have this map, which I show some red markers over and whenever a
I have exported a map to a .osm file (this is an xml). I
I have the following: An image - a hand drawn map - of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.