Select to view content in your preferred language

how to add image layer with particular lat-long

1238
7
09-27-2019 04:13 AM
NishidhKhanapara
Emerging Contributor

Good Evening arcgis team,

i want to add particular image layer on specific. Other thing is if i am zoom in and zoom out map then that image will also zoom in and zoom out accordingly. in android an ios is there any ex maple or any method for that ?

0 Kudos
7 Replies
MarkBaird
Esri Regular Contributor

I've not understood your question, so I'm guessing here.  I'm wondering if a callout is what you are wanting.  This is a container you can add to your map which can contain text or an image for example.

arcgis-runtime-samples-android/java/show-callout at 65533272642bd366e31af709c250063ded30219a · Esri/... 

The other thing you can look at is PicureMarkSymbols.  There is where you can draw a graphic on the screen which is symbolised with an image.  

arcgis-runtime-samples-android/java/picture-marker-symbols at 65533272642bd366e31af709c250063ded3021... 

Does this help?

0 Kudos
Kae_WoeiKang
Emerging Contributor

Hi Nishidh,

I understand your question here as I am facing the same issue. I am using PictureMarkerSymbol to add image onto map.. I am too, facing the issue where to image size is fixed on screen, and not relatively adjust when I zoom in and out on the map. There is no issue by moving the map left to right though.

Have you found a solution for this problem? 

Thanks!

Kae Woei

0 Kudos
MarkBaird
Esri Regular Contributor

A PictureMarkerSymbol is for putting markers on a map to show the location of something.  This might be a push pin for example.

Can you tell me what this image is that you are trying to add to the map?  If this image is spatial data (like an aerial photograph) then you shouldn't be looking at PictureMarkerSymbols.

If you tell me a little more about what you are trying to do and maybe show some pictures I can help.

0 Kudos
Kae_WoeiKang
Emerging Contributor

Hi Mark, 

Thanks for replying. I am trying to add a floor plan image onto campus building. Therefore, the floor plan will dynamically resize depends on user's behavior (zoom in or out of the map). I have the 4 corners (top left, top right, bottom left, bottom right) coordinates which I wish to pin onto the map.

However, I can only defined a polygon and get the center point and assigned it in the constructor of Graphic class. As the result, the floor plan is located at the center of polygon, with its defined pixel size which is constant regardless of user behavior (double tap, pinching in or out).

Graphic graphic = new Graphic(p.getExtent().getCenter(), pictureMarkerSymbol);

Thanks and best regards,

Kae Woei

0 Kudos
MarkBaird
Esri Regular Contributor

I'm getting a better understanding of what you are trying to do.  

So when displaying information you typically have vector data (made up of points, lines and polygons) or raster data (aerial photographs for example).  You mention the an "image" which suggests raster data to me, but you don't say what format of raster data you are working with.

There are lots of formats of data which have geo-reference data included in the format.  This means that the file contains information about the location of the corners of the data.  If you are working with one of these formats, then what you are trying to do is very easy.  We have a sample in git showing how to do this:

arcgis-runtime-samples-android/java/raster-layer-file at 81a23fb7814cebe376bf3979a70a599c66742679 · ... 

More information on RasterLayers are here.

Add raster data—ArcGIS Runtime SDK for Java | ArcGIS for Developers 

If course its possible that the image data you have isn't geo-referenced.  If this is the case, then you need to a little more work to display your data.  You'll have to tell me if you need extra information here.

Does this help?

Kae_WoeiKang
Emerging Contributor

Hi Mark,

Thank you for your promptly reply. I have found an alternative solution by using reference scale. However it has the limitation whereby multiple floor plans images with different sizes; are required to be add onto the map. I will explore on your sample git codes and deploy the suitable solution for my project.

Map reference scale | ArcGIS for Developers 

Thanks and best regards,

Kae Woei

0 Kudos
MarkBaird
Esri Regular Contributor

This isn't what map reference scale was intended for.  I'd really encourage you to go down the route of RasterLayers.  If you need guidance on geo-referencing your data let me know.  Hopefully your data will already be geo-referenced.

0 Kudos