2014年8月4日 星期一

LCGMap -- Google Map on LiveCode

Google Map is a well know online map services and is widely used in mobile apps. I made this livecode program as module to plug into any other livecode programs. Google has release many functions' api. I just implement some of them. As you may see in this article and the demo videos.

The video link is here : http://youtu.be/PHU9I-CiRks

First thing to is to display a map with central point sets.
I set the center of this map to "台北" which is the Traditional Chinese for "Taipei". It's the capital city of Taiwan. Also set the zoom to 12. In my LCGMap, you can use either latitude and longitude or the name of that place to set the locations.

Next, I can add some markers to the position where I want. As you can see two maker field. One use latitude and longitude the other use English name of the location. Here's the result.

We can use the direction service of Google Map, too. Just set the start location and the end location. When I click "Direct" the route will calculate and draw on the map.

The second card show the Google Places service. It can find the restaurants, parks, banks and other types of places you are looking for. It can also set the radius for a fix location to find out the places in this area. In this demo I set the radius to 5000 meters as default. First I set the central location to Taipei city and search for the banks in 5000 meter radius.
When clicked the marker. It will show the name of this place.

Then I change the type to restaurant and search again. You can see the restaurants in this area.

I've accomplish just a few functions in Google Map. But these are some functions I often use. Maybe more when I have time:)