Start a new topic

Problem with radar

Problem with radar


hallo,

here's the code i try to use to show up radar in ARchitect:

<script src="architect://architect.js"></script>
<script type="text/javascript">
AR.radar.background = new AR.ImageResource("radarImg.png");
AR.radar.positionX = 0.1;
AR.radar.positionY = 0.1;
AR.radar.width = 0.4;
AR.radar.centerX = 0.5;
AR.radar.centerY = 0.5;
AR.radar.radius = 0.4;
AR.radar.northIndicator.image = new AR.ImageResource("north_arrow.png");
AR.radar.northIndicator.radius = 0.4;
AR.radar.onClick = function(){ AR.logger.info(?radar was clicked?);};
AR.radar.enabled = true;
</script>
<script type="text/javascript">
function createLabelAtLocation(mygeolocation)
        {
            var radarCircle = new AR.Circle(0.05, { style: {fillColor: '#83ff7b'}});
            
            var myStyle = {fillColor : '#FF0000', outlineSize : 30, outlineColor : '#000000'};
            
            var Mycircle = new AR.Circle(1, {style : myStyle});
            
            var mygeolocation =  new AR.GeoLocation(yy.yyyyyyyyy, xx.xxxxxxx, 0);
            
            var geoObject = new AR.GeoObject(mygeolocation, {drawables: {cam: Mycircle, radar: radarCircle}});
            
        }

        function setupScene()
        {
            
            createLabelAtLocation();
        }

        </script>

</head>
<body onload="setupScene()">
</body>

but got no radar on the screen. Can you help me please?!?!

Thank you

 

Hi There!

First of all thank you for your interest in our SDK.

I tried out your code and it seems like you had a syntax error in your Log message for the Radar clicking

Try to change:

AR.radar.onClick = function(){ AR.logger.info(?radar was clicked?);};

to

AR.radar.onClick = function(){ AR.logger.info("radar was clicked");};

Let me know if that helped.

Thx, Markus

now it works!

Thank you!!
Login or Signup to post a comment