Offset text position based on Long & Lat's

how-to

#1

Hi, I have a business directory populated via an excel spreadsheet. On one of my scenes which lists all the businesses I have a button which when tapped loads a map and shows the position of the business. When the map loads an icon is displayed based on the Long & Lat position along with a text box which also uses the Long / Lap position and also pulls the name from a excel file. All of which is working fine :slight_smile:

What I would like to be able to do is off set the text box slightly as it uses the same Long / Lat position as the icon and therefore is slightly covered. Is this possible ?

Is it also possible to alter the focus / zoom based on the location chosen from the excel file? I’ll explain…when my map loads an image is placed at the position the screen is located with a “you are here” text box. I have zoom set to 18 by default which works for 60% of locations chosen but sometimes the business selected is off screen. Is it possible to alter the zoom so that both the business location and the “you are here” position is always viewable?

Thanks…


#2

Hi Rod,

Regarding the “offset” for your text, I think the easiest solution would be to put your Text in a Group. The group center position will be bound to the lat / long coordinates. You just have to move the text inside that group so it’s positioned relatively to the group center.

As for the “best” zoom level to display 2 points on a map, this could be programmed in a custom JavaScript Interface Asset. This requires some development skills and a bit of maths, but is totally doable.

Seb