mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 912 forks source link

map is not loading second time #167

Closed ammubasha closed 9 years ago

ammubasha commented 9 years ago

after successful implmentation in android i tried the same in IOS. first time it is working fine second time the map in not showing..... map object is not null but still the map is not shown up. i even try refreshlayout still no luck....anything i need to do specific to IOS

wf9a5m75 commented 9 years ago

Could you show me your code?

wf9a5m75 commented 9 years ago

@ammubasha Could you test the code #118 ?

ammubasha commented 9 years ago

function getMapLayout() { clearMap(); var div = document.getElementById("map_canvas"); // alert("map"+map); map = plugin.google.maps.Map.getMap(div); map.addEventListener(plugin.google.maps.event.MAP_READY, function onMapInit(map) { // The map is initialized, then show a map dialog map.refreshLayout(); map.setVisible(true); getMyLocation(); }); }

function clearMap(){ if(map!=null){ map.clear(); map.setVisible(false); map.setDiv(null);

}

}

function getMyLocation() { $('#listDet').css('display', 'none'); $('#gmap').css('display', 'block');

 // map.showDialog();
// var latLng = new plugin.google.maps.LatLng(38.9030076,35.8615186);

 map.getMyLocation(function(location) {

  map.addMarker({
    'position': location.latLng,
    'title': "You are here!",
    'icon': {
        'url': 'www/images/b7.png',
        'size': {
        'width': 30,
        'height': 40
        }
    }

  }, function(marker) {

    map.animateCamera({
        'target':location.latLng,
        'zoom': 17

    });
  });
});
}


> wrote:
> 
> Could you show me your code?
> 
> —
> Reply to this email directly or view it on GitHub
> https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/167#issuecomment-51565926
> .
wf9a5m75 commented 9 years ago

Thank you very much!

ammubasha commented 9 years ago

any suggestion on this?

On Fri, Aug 8, 2014 at 12:49 PM, Masashi Katsumata <notifications@github.com

wrote:

Thank you very much!

— Reply to this email directly or view it on GitHub https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/167#issuecomment-51570588 .

wf9a5m75 commented 9 years ago

I reviewed map.getMap() action yesterday, and I probably fixed this issue in next release.

wf9a5m75 commented 9 years ago

I added some code for v1.1.5, and it is now available. I hope the code solves this issue. Please try the latest version.

In order to update, remove the plugin at once, then add the plugin again.

$> cordova plugin rm plugin.google.maps
$> cordova plugin add plugin.google.maps --variable API_KEY_FOR_ANDROID= ... --variable API_KEY_FOR_IOS=...
ammubasha commented 9 years ago

Thanks. we solved this somehow with dirty fix-:) anyhow will try the new release

On Fri, Aug 29, 2014 at 10:46 PM, Masashi Katsumata < notifications@github.com> wrote:

I added some code for v1.1.5, and it is now available. I hope the code solves this issue. Please try the latest version.

In order to update, remove the plugin at once, then add the plugin again.

$> cordova plugin rm plugin.google.maps $> cordova plugin add plugin.google.maps --variable API_KEY_FOR_ANDROID= ... --variable API_KEY_FOR_IOS=...

— Reply to this email directly or view it on GitHub https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/167#issuecomment-53904582 .

wf9a5m75 commented 9 years ago

@ammubasha Did you resolve this? I'd like to close this issue if you resolve this.

wf9a5m75 commented 9 years ago

Please try the new version of the plugin. This problem should be fixed. (I tested many times) https://plus.google.com/112861993350247152906/posts/ber5LChbWkU

wf9a5m75 commented 9 years ago

The problem is fixed in v1.2.0