Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Creating a circle with a fixed radius in kilometers

Creating a circle with a fixed radius in kilometers

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Creating a circle with a fixed radius in kilometers

Postby TheGuest » Sun Oct 18, 2009 10:14 pm

Hi people,

I am creating an application where I need to show to the user a proximity radius. I know I can draw a circle with canvas.drawCircle(), but the input it requires is in pixels.
So my questions are as followed, how do I calculate the radius of a circle which needs to be for example 5 kilometers into pixels?
And how do I keep it in the correct perspective when zooming?
TheGuest
Freshman
Freshman
 
Posts: 2
Joined: Sun Oct 18, 2009 10:02 pm

Top

Postby TheGuest » Mon Oct 19, 2009 11:01 pm

Man how could I have been so blind, after digging around I found the following method:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. float radius = projection.metersToEquatorPixels(2400);
Parsed in 0.016 seconds, using GeSHi 1.0.8.4


This should give me a radius in pixels of 2.4 kilometers. Unfortunately it's not 2.4 kilometers, more like 1.5... Strange, but it will have to do I guess...
TheGuest
Freshman
Freshman
 
Posts: 2
Joined: Sun Oct 18, 2009 10:02 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests