Viewing Large Images Using Groups and Adding Buttons to the Map Group?

Brent Anderson brent at juicydevelopment.com
Fri Jul 15 18:17:48 EDT 2011


I actually did this on iOS recently. Incidentally, I scrapped the grouped map/button concept in favor of an HTML implementation (which, depending on your application, could be a good idea).

But, if you're interested in using buttons and an image in a grouped implementation, I used two groups. One group, called "mapLayer", contained the map and pins I dropped on the map. This group contained the "grab me" code, and it was also full size (no scrollbars). It was then grouped within another group called "mapContainer". This "mapContainer" group was of fixed size and was the "window" to the map, including scrollbars, etc. You cannot group a group using LiveCode's development environment, but you can use the message box to issue a group command to stick the mapLayer inside the mapContainer:

group grp "mapLayer"

Then rename the resulting group as "mapContainer". Alternatively, you can create another object like a button and group it with the mapLayer group. Edit this new group, delete the button so all that is left is the mapLayer, and rename your new group "mapContainer" (or whatever you prefer, these were the names I used).

Cheers,
Brent Anderson
Juicy Development

On Jul 15, 2011, at 3:52 PM, John Patten wrote:

> Hi All!
> 
> I have a few questions about large images, buttons and groups....
> 
> I have a card that I want to place a large map image on. I know I can put it into a group, size the group,  and turn the scroll bars on to navigate the large image.
> 
> Is it possible to navigate map in a group with just by dragging/Grab me? Similar to what you might due on a tablet and iOS/Android? I need to be able to navigate the image and have my button markers stick to the image not float on top.
> 
> Now, if I attach a "grab me" to the image, the image moves but the button marker float above. If i attach a grab me to the group, the whole group moves but not the map. Ideas?
> 
> 
> Also, if i want to add cd buttons to the map group one at a time, how would I go about doing that?
> 
> Lock screen
> set the rect of group "map" to the rect of image "largeMapImage"
> put 1 into x
> repeat 5
> 
> add cd button x to group "map" of cd 1 -- this does not seem to work for me???
> 
> set the loc of cd button x to line x of tListofLocations -- retrieving the loc coordinations from a database and storing them in tListLocations
> add 1 to x
> end repeat
> 
> (Most importantly, how do I add buttons to a the map group, with out throwing off the locs of the  current button markers in the group.)
> 
> The buttons need to be buttons  because they are used to navigate to information regarding that specific location on the map and some can change their loc via user placement (grab me).
> 
> In order to do what I want to do, is it only possible by assigning the buttons to the map group (?) and then using the scroll bars of the group to navigate the map? Would that work inside iOS and Android (that = group scroll bars) too?
> 
> Thank you!
> 
> John Patten
> SUSD
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list