Start a new topic

AR.Radar

AR.Radar

I am trying to add a radar screen to my wikitude window to no avail.

Your documentation says....
The Singleton instance of the class will automatically be created on World
startup and can be accessed via AR.radar.

However, maybe I am just not getting it, but no matter where I put your sample radar code on your site, it does not work inside of my code.

So, here is teh question of this post.  Using your sample android code as a starting point, where would a person actually add the AR.radar code to make it show up.

Thanks,
Steven Saxton
Hello, is anyone out there that answers these questions?
Hi there!

Sorry for delay.

You can access and set-up the AR.radar in the html's script section, e.g. right on top



          
My ARchitect World


// access and configure radar, called once on launch
var radar = AR.radar;
radar.centerX = 0.5;   
radar.centerY = 0.5;







Hope that helps.

Cheers,
Andi
OK, Thanks for the help, but I am still struggling with last part where the little dots should actually be showing up on top of the radar.  EVERYTHING ELSE WORKS GREAT
Can you peak at the last few lines and tell me where I am going wrong. The location I am using is the exact spot where I am standing when I run the wikitude and it doiesn;t show up, yet all of the poi's that are around that area show up on the regular wikitude screen as POI's

  var radar = AR.radar;
  radar.background = new AR.ImageResource("radarBG2.png");
  radar.positionX = 0.02;
  radar.positionY = 0.06;
  radar.width = 0.3; 
  radar.centerX = 0.5;
  radar.centerY = 0.5;
  radar.radius = 0.4; 
  radar.northIndicator.image = new AR.ImageResource("northPointer.png");
  radar.northIndicator.radius = 0.3;  
  radar.onClick = function(){AR.logger.info('TESTING - radar was clicked');};
  radar.enabled = true;  
FROM HERE DOWN, IT DOESN'T SEEM TO WORK
  var radarCircle = new AR.Circle(0.05, {style: {fillColor: '#FFFFFF'}}); 
  var geoLocation = new AR.GeoLocation(41.8642569333315,-72.4768723547459,0);
  var firstImage = new AR.ImageResource("marker1.png");
  var geoObject = new AR.GeoObject(geoLocation, {drawables: {cam: firstImage, radar: radarCircle}}); 

I am trying to hard code a circle to start with and then go off from there after I get that to work properly.

Thanks,
Steven Saxton
Hi Andreas

  I was trying to get AR.radar to wotk with no luck using the code snippet below. Everytime I put them in the html page which will cause error and the camera preview blank with no geo points I define.  If I commented them out, the page loaded successfully.
---
var radar = AR.radar;            radar.background = new AR.ImageResource("radarImg.png");            radar.positionX = 0.1;            radar.positionY = 0.1;            radar.width = 0.4;            radar.centerX = 0.5;            radar.centerY = 0.5;            radar.radius = 0.4;            radar.northIndicator.image = new AR.ImageResource("north_arrow.png");            radar.onClick = function(){ AR.logger.info(?radar was clicked?);};            radar.enabled = true;
---
  Any idea? Thanks.

-Eric
Ok, finally I have got it working after some trial and error testing. Things to do are
1. Comment out the following line of code as it causes error.
//AR.radar.onClick = function(){ AR.logger.info(?radar was clicked?);}; 
2. Make sure to replace the "markerDrawable" in the following line of code to a drawable of your own defined in your codes.
var geoObject = new AR.GeoObject(geoLocation, {drawables: {cam: markerDrawable, radar: radarCircle}});

Origianl wkitude how-to on adding radar can be found here at http://forum.wikitude.com/documentation?p_p_id=122_INSTANCE_EcHJ3oaMeiBE&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-3&p_p_col_count=1&p_r_p_564233524_resetCur=true&p_r_p_564233524_categoryId=28753

Hope it's helpful. Instant radar. -Eric
Login or Signup to post a comment