Jump to content

Map blips


sanyisasha

Recommended Posts

Hello, i want to create a map to my dashboard, but i can't fix the blips positions.

It's not a full map, only an image section.

https://scontent-vie1-1.xx.fbcdn.net/hphotos-xpt1/v/t35.0-12/12449235_1666821136931378_230067199_o.jpg?oh=268ab8d7d37b3aecd9ce28355e7b51d0&oe=5681CBCD

In this image you can see the blue dott. And it's not in good position.

Here the real:

https://scontent-vie1-1.xx.fbcdn.net/hphotos-xat1/v/t35.0-12/12422245_1666657106947781_2105292589_o.jpg?oh=e9ec043976e6e950fcb6649649428a57&oe=5680D048

(Here only the white blip, that's the real position)

My algorithms:

  
local worldX, worldY = getElementPosition(elem) 
x = ((3000 + worldX) * (box[1] / 6000) - m_startx)*m_zoom 
y = ((3000 - worldY) * (box[2] / 6000) - m_starty)*m_zoom 
--box[1 and 2]: the map actual shoved size(In first image what you can see, the "box" size) 
--m_startx/m_starty: image section start x,y 
--m_zoom: actual zoom. (In default: 1) 
  

Thanks if you can help ^^

SaSha

Link to comment
Hello, i want to create a map to my dashboard, but i can't fix the blips positions.

It's not a full map, only an image section.

https://scontent-vie1-1.xx.fbcdn.net/hphotos-xpt1/v/t35.0-12/12449235_1666821136931378_230067199_o.jpg?oh=268ab8d7d37b3aecd9ce28355e7b51d0&oe=5681CBCD

In this image you can see the blue dott. And it's not in good position.

Here the real:

https://scontent-vie1-1.xx.fbcdn.net/hphotos-xat1/v/t35.0-12/12422245_1666657106947781_2105292589_o.jpg?oh=e9ec043976e6e950fcb6649649428a57&oe=5680D048

(Here only the white blip, that's the real position)

My algorithms:

  
local worldX, worldY = getElementPosition(elem) 
x = ((3000 + worldX) * (box[1] / 6000) - m_startx)*m_zoom 
y = ((3000 - worldY) * (box[2] / 6000) - m_starty)*m_zoom 
--box[1 and 2]: the map actual shoved size(In first image what you can see, the "box" size) 
--m_startx/m_starty: image section start x,y 
--m_zoom: actual zoom. (In default: 1) 
  

Thanks if you can help ^^

SaSha

URL signature expired

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...