Total Pageviews

Wednesday, March 12, 2014

ចង់មើល Map លើ Devices របស់អ្នកទេ

មាន API របស់ Native មួយនៅក្នុង Corona SDK ដែលអាចមើល Map បានដែរ។ វាប្រើសំរាប់ Render នឹងបន្ទាប់មកបង្ហាញ Object។ វាមិនអាចមើលឃើញនៅក្នុុងកុំព្យូទ័ររបស់អ្នកបានទេ។ សំរាប់ androids ត្រូូវធ្វើការ Config នៅក្នូង build.setting
settings =
{
    android =
    {
        usesPermissions =
        {
            -- Required by the MapView to fetch its contents from the Google Maps servers.
            "android.permission.INTERNET",

            -- Optional permission used to display current location via the GPS.
            "android.permission.ACCESS_FINE_LOCATION",

            -- Optional permission used to display current location via WiFi or cellular service.
            "android.permission.ACCESS_COARSE_LOCATION",
        },
        usesFeatures =
        {
            -- If you set permissions "ACCESS_FINE_LOCATION" and "ACCESS_COARSE_LOCATION" above,
            -- then you may want to set up your app to not require location services as follows.
            -- Otherwise, devices that do not have location sevices (such as a GPS) will be unable
            -- to purchase this app in the app store.
            { name = "android.hardware.location", required = false },
            { name = "android.hardware.location.gps", required = false },
            { name = "android.hardware.location.network", required = false },
        },
    },
}

Syntax: native.newMapView( centerX, centerY, width, height )

centerX, centerY: (តំរូវការ) ចំនុចកណ្តាល់ របស់ X,Y របស់ Map
width, height: (តំរូវការ) ជា Width & Height របស់ Map

No comments:

Post a Comment