Start a new topic

ImageDrawable for POI in AR view

ImageDrawable for POI in AR view


Hi,

 

I try to display an image coming from my API for the POI in the AR view.

Payload : https://api.getwemap.com/v2.2/EMM?ltoken=at5788eb835a81c9.75928685&emm_id=2069&center_latitude=48.12129&longitude_delta=22.01660&limit=400

In marker.js

  // create an AR.ImageDrawable for the marker in idle state

  this.markerDrawable_idle = new AR.ImageDrawable(poiData.imageResource, 2.5, {

   zOrder: 0,

   opacity: 1.0,

 

In fromWebservice.js 

 

I tried with hard coded path for image and it works (see screen shot attached with little pikachu):

var data = poiData.pinpoints;

// loop through POI-information and create an AR.GeoObject (=Marker) per POI

for (var currentPlaceNr = 0; currentPlaceNr < data.length; currentPlaceNr++) {

var singlePoi = {

"id": data.id,

"latitude": data.latitude,

"longitude": data.longitude,

"altitude": 100,

"title": data.name,

"description": data.media_url,

"imageResource" : new AR.ImageResource("https://api.getwemap.com/images/pps-picpoints/c7c0c3b1cc4f36654d5b6e6f.10833102.png")

};

when I try to use data from my json by using corresponding path it no longer works. I know my json is loaded correctly with the correct  url since I display the same url in description (see screenshot attached w/o pikachu).

var data = poiData.pinpoints;

// loop through POI-information and create an AR.GeoObject (=Marker) per POI

for (var currentPlaceNr = 0; currentPlaceNr < data.length; currentPlaceNr++) {

var singlePoi = {

"id": data.id,

"latitude": data.latitude,

"longitude": data.longitude,

"altitude": 100,

"title": data.name,

"description": data.media_url,

 "imageResource" : new AR.ImageResource(data.media_url)

  };

Any help would be very much appreciated.

 

 

Hi Pierre,

Your issue seems to be related to this post.
I'd write the same answer as in our previous conversation.

Wheter you use hardcoded value or the value from a JSON object doesn't make a difference in runtime, so most likely a typo or syntax issue caused the troubles.

Best regards,
Andreas
Login or Signup to post a comment