How does map.draw() function in Unfolding Map work?

Hi, I was trying to search information about this map.draw() function, but I did not find anything about this at all. Could anyone kindly let me know the purpose of this function or point to some links/references?

The following is a part of the code.

void draw( )  {
        if (frameCount < totalFrames) {
           map.draw();   //  what it this? 
           noStroke();
           fill(0, screenfillalpha);
           rect(0,0,width,height);
        }
} 

Many thanks for your time and attention.

1 Like

-a- out of context it could not be understood.
the minimum to get this working is:

/* An application with a basic map.*/

import de.fhpotsdam.unfolding.*;
UnfoldingMap map;

void setup() {
  size(800, 600, P2D);
  map = new UnfoldingMap(this);
}

void draw() {
  map.draw();
}

-b- in words: you call
the draw() method of the ( “map” what is of ) class “UnfoldingMap”

-c- in all provided examples it is used same

-d- did you look at the documentation?

    • Processing IDE / Help / Libraries Reference / Unfolding Maps /
    • or just use filemanager
      … /libraries/Unfolding/reference/index.html

find
Map draw

draw
public void draw()
Updates and draws the map. The main method to display this UnfoldingMap.

there is no more ( like no parameter… if you ask that?)

but possibly you ask about other methods:

getLocationFromScreenPosition

@Deprecated

getLocation

public [Location] getLocation([ScreenPosition] screenPosition)
Converts a position on the screen to a geographic location.
Parameters:
screenPosition - The position in screen coordinates.
Returns:
The geographic location with latitude and longitude.

2 Likes