Hello Thunkers !
I start to work with map component, and I don’t know what I’m doing wrong here:
It’s a simple task, calling current device coordinates then putting an icon on the map for these coordinates.
But I wanted the map to move and focus on those coordinates… and I don’t manage to do it… I thought that setting map latitude/longitude is doing that. But map stays on default values and need to manually move and zoom to coordinates to find my marker
Are you testing this in Thunkable Live? Have you granted permission for the location sensor during first run of the app?
Yes, and yes … Location sensor is just fine, as it puts marker on correct coordinates retrieved … Only that I have to manually move and zoom the map to go to the marker.
I put marker and set map in Romania, where I am, and map starts around San Francisco
This works for me in Thunkable Live on an iPhone 11:
(See the first screen; it has your username)
Yes, your example works on My Android too…
It focus on my house…
But the code is the same as mine…
The only difference is that your example is in DnD and I try in StP… and mine doesn’t work
GetCurrentLocation should automatically focus the map to your current location.
As both codes (mine and @tatiang ) are the same, and my StP reacts different than his DnD, maybe something is wrong in StP ?
Edit: my mistake! See below… the blocks do work when corrected.
When I use similar blocks in StP, it doesn’t Zoom. It just shows my location while displaying several continents. I can’t get it to do anything really. It doesn’t always update my location either.
So, it’s a StP issue …
Just my luck. When I start learning something new, I encounter a bug, letting me confused thinking that I don’t use blocks right
May I kindly ask you @jared to take a look into this issue ?
I removed the
zoom option and corrected a small mistake that you’ve overseen which is having
latitude instead of
longitude and the map responded perfectly.
This is where I am now although I don’t look like a baby chicken.
You’re right! I made a mistake… thanks for catching that.
Reminds me of a certain cat video.
@mimostel Can you try this StP project? The first screen works for me on an iPhone 11:
Yes, yours works, mine still doesn’t. Checked again the blocks and are the same. Really weird.
I’ll try again with new map later, when I’ll be on computer. My map has everything default before blocks. Did you changed anything on it ? Or maybe because my map fills the container and yours has absolute values as height/width. I’ll try all option and I’ll see. I’ll let you know.
Thank you and @muneer for wasting time for me
I just added the map component. I didn’t change any settings.
Maybe try removing your map component and re-adding it?
It seems that set visibility for row that contain map to false/true was interferring with moving/zooming map.
Bottom line: map needs to be visible when focusing/zooming. (cannot be hidden and displayed only after operations are done, with a nice waiting icon displayed instead )
This should be fixed because you don’t want the user to have to see the default location before it finds their location and zooms in.
That was my point when I have hidden the map and revealed it only after the calculations were done… but… can’t be done atm… well, there’s other things to be done more important now than my esthetic taste so no rush in “fixing” this.
P.S. My users will start from my house now haha (as I put my coordinates as default on map)