Howto for a map-like application, which way to go?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Olaf Hamann
Posts: 4
Joined: Sat Aug 01, 2009 1:55 pm

Howto for a map-like application, which way to go?

Post by Olaf Hamann » Wed Aug 12, 2009 5:29 pm

Hello all,

thank you very much in advance for your patience with reading my broken english ;-)

I'm really excited about the Revolution Environment (worked in the 90's with HyperPad from Brightbill Roberts on a DOS-PC) and can't really wait to start writing my first useful application after having done some tutorials so that I'm used to the basics.

I would like to write a map-like application, think of an srollable/perhaps zoomable area with about 40.000 city markers. Not all of the citiy markers will show additional information when clicking on them or so.
It is asked for the color of the city markers to be changed very fast - think of Buttons 'hilite my cities' and 'hilite cities of my group' .
(This map shall show the playing field of a browser game, which I enjoy to play)

Now my question to you experienced Rev Users: Which way of implementation would you advise me to choose:

* build the city markers as buttons (or group of buttons), each button 1 city marker and place them on a background

* create the city markers as a graphics inside Revolution
** may they act as mouse sensitive as buttons?

* create the whole region with all cities as en external image (actually I do this with ImageMagick) and put only the interesting spots as Rev objects in front of that at the right coordinates (cover the image at this city)
** is it easy to scroll that image region with the city Rev objects being scrolled correctly too?

* or do you have an idea, which is much more the way, revolution would solve this

It might be that you experienced folks will tell me "there is no way to handle about 40.000 objects on one card with acceptable performance to the user".
Then I will think about splitting the whole area in more regions with less city markers.
In this case, could you give me a hint for a number of Rev objects which may be handled on one card with acceptable performance?
It ist not necessary to see more than about 1000 city markers at one time, but it should be very fast to drag the map in any direction to come to the area which one would examine in more details.


I hope, you can guess what I mean with this words above.
If not, I will try to clarify that.

If there are any tutorials or example stacks which deal whith the mentioned problems, don't hesitate to simply put a 'look here, lazy fool' as an answer :-)


I would be glad to read from you,
thank you very much,

kind regards,

Olaf Hamann

Olaf Hamann
Posts: 4
Joined: Sat Aug 01, 2009 1:55 pm

Re: Howto for a map-like application, which way to go?

Post by Olaf Hamann » Sat May 15, 2010 10:10 am

Hmm, what's wrong with this post?
I'm still interested in this point.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Howto for a map-like application, which way to go?

Post by Mark » Sat May 15, 2010 12:43 pm

Olaf,

You post lacks any technical references. If you ask questions such as "how do I quickly show and hide an object" then we can tell you how to lock the screen and use the show, hide and set commands and the location property, for instance. Yes, 40000 objects is pretty crazy and most people probably don't even bother answering such a question. However, you can have a database or even a simple list with 40000 co-ordinates and only create and dispaly as many objects as needed. Keep in mind that a user never needs to see 40000 individual objects. You can aggregate.

Make a plan, try to accomplish something with Revolution and ask questions when you get stuck.

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

kotikoti
Posts: 72
Joined: Tue Apr 15, 2008 7:35 pm

Re: Howto for a map-like application, which way to go?

Post by kotikoti » Sat May 15, 2010 12:59 pm

Hi Olaf Hamann,
I assume that this can be done but more info would be needed to assist the thinking process.

I assume from a map-like application, you want to be able to drap the "canvas" onto which your city is drawn, same way a google-maps application would, and the city markets you mention are what you would see in the google-map reference. If that is the case, one would need to understand how your "buttons" are asiigned the co-ordinate. Anyway before I go off course from what you actually need, I think a simpler question supported my images would assist folks here to understand your requirement.

I have knocked this up to give you an idea of how a drag-drop can be achieved for a big image in a small stack window, of-course alot more coding is required to implement something similar to a mapping tool.

things to read on are

globalloc
localloc
mouseloc

any tools for co-ordinates manipulation.


p.s drap-drop code was picked from a contribution on this forum, and was more for managing moving a stack window, but believe can be a basis of your implementation.
Attachments
map.zip
runrev 2.9 zip file.
(953 Bytes) Downloaded 279 times
Build 160
Version 2.9.0
Platform: Windows

Post Reply