title: How to create a simple map scale bar in geotools
body: <p>Using GeoTools I was able to display a simple shape file using JMapPane class. My requirement is to draw a bar much like in any maps that shows the scale of the map on display in meters in relation to the length of the bar as I zoom in/out.</p>
  
  <p>I've been searching for days now and I just couldnt find any concrete hint.</p>
  
  <p>Even a way to convert two given points in a map to distance in pixels would really help me</p>
  
  <p>Please any hint is greatly appreciated.</p>