# Problem position imagelayer

**URL:** <https://community.cesium.com/t/problem-position-imagelayer/6136>\
**Category:** CesiumJS\
**Created:** [October 13, 2017, 9:57am UTC](https://community.cesium.com/t/problem-position-imagelayer/6136 "2017-10-13T09:57:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromefaure93](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@jeromefaure93](https://community.cesium.com/u/jeromefaure93)\
**Post date:** [October 13, 2017, 9:57am UTC](https://community.cesium.com/t/problem-position-imagelayer/6136/1 "2017-10-13T09:57:46Z")

</div>

Hello

I have a problem of positioning the weather image, i need your help ! 🙂  
I will explain to you.

I want to display weather data on the globe according to coordinates

So I retrieve the coordinates of the view with computeViewRectangle, then I ask a remote base the weather image corresponding to my view with its coordinates and then I integrate the image into Cesium.

Here is my simple code:

var imageryLayers = viewer.imageryLayers;  
var rect = viewer.scene.camera.computeViewRectangle();  
north = rect.north;  
south = rect.south;  
west = rect.west;  
east = rect.east;

var mylayer = imageryLayers.addImageryProvider(new Cesium.SingleTileImageryProvider({  
&nbsp;&nbsp;url : url,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rectangle : Cesium.Rectangle(west, south, east, north)   
&nbsp;&nbsp;}));

But the image is not positioned in the right place, look!

//Image from the weather database and displayed on their map  
[http://hpics.li/8be8ef1](http://hpics.li/8be8ef1)

//Image alone i download from the weather database  
[http://hpics.li/903c2b6](http://hpics.li/903c2b6)

//Then image integrated on Cesium  
[http://hpics.li/34bc215](http://hpics.li/34bc215)

I do not know where the error came from.I know of no other way to do it.  
So can you help me please ? 🙂

p.s: I have to convert the coordinates in degree to get the weather image from my database

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [October 16, 2017, 9:09pm UTC](https://community.cesium.com/t/problem-position-imagelayer/6136/2 "2017-10-16T21:09:33Z")

</div>

Hey there,

Do you have the exact location that the imagery should be positioned at from the weather database? It looks like you are creating the location of the TileImageryProvider from the current view of the camera (with viewer.scene.camera.computeViewRectangle) rather than the absolute position of the data.

Thanks!

Gabby
