tidev / ti.map

Use native Apple Maps & Google Maps in iOS and Android with Axway Titanium
Other
49 stars 129 forks source link

Request to add Android Google Maps Inset (code provided) #165

Closed yozef closed 8 years ago

yozef commented 8 years ago

Android has ALWAYS given me issues packaging the module:

If anyone can compile it with this code: Add in TiUIMapView.java: https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/TiUIMapView.java

// around line 306
protected void setMapInset(HashMap<String, Object> dict) {

        float left = 0;
        float top = 0;
        float right = 0;
        float bottom = 0;

        if (dict.containsKey(MapModule.PROPERTY_MAP_INSET_LEFT)) {
            left = TiConvert.toFloat(dict, MapModule.PROPERTY_MAP_INSET_LEFT, 0);
        }
        if (dict.containsKey(MapModule.PROPERTY_MAP_INSET_TOP)) {
            top = TiConvert.toFloat(dict, MapModule.PROPERTY_MAP_INSET_TOP, 0);
        }
        if (dict.containsKey(MapModule.PROPERTY_MAP_INSET_RIGHT)) {
            right = TiConvert.toFloat(dict, MapModule.PROPERTY_MAP_INSET_RIGHT, 0);
        }
        if (dict.containsKey(MapModule.PROPERTY_MAP_INSET_BOTTOM)) {
            bottom = TiConvert.toFloat(dict, MapModule.PROPERTY_MAP_INSET_BOTTOM, 0);
        }

        map.setPadding(left, top, right, bottom);
    }

and in MapModule.java: https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/MapModule.java

// around line 65:
public static final String PROPERTY_MAP_INSET_LEFT = "left";
public static final String PROPERTY_MAP_INSET_TOP = "top";
public static final String PROPERTY_MAP_INSET_RIGHT = "right";
public static final String PROPERTY_MAP_INSET_BOTTOM = "bottom";

If you manage to package the module, in Titanium:

mapView.mapInset = {left: 0, top: 0, right: 0, bottom: 200}; // Should see the Google Logo on Google Maps move up
hansemannn commented 8 years ago

Lets figure out how to build properly, but please make a PR first 😊

hansemannn commented 8 years ago

@yozef Still want this improvement? We need a JIRA-ticket, demo-code and PR from you to communicate the feature-request. Closing this one for now.

de1mat commented 7 years ago

What happened with this request? I need to inset the map, but not sure how to do it. I could not find a JIRA ticket. Seems the process is wrong if this issue is closed but nothing is done with it. It is a necessary feature...