LoginSignup
0
1

More than 5 years have passed since last update.

GoogleMapsのリンクをアプリ内でページ遷移される件

Last updated at Posted at 2015-06-23

GoogleMapsの左下のロゴや右下のリンクなどをクリックすると、WebView内でページ遷移されてしまう。

地図の初期化後にイベントを定義する

// イベント定義
setTimeout(function(){
    var elms = Ext.select(".x-map a");
    Ext.Array.each(elms.elements, function(elm, index, countriesItSelf){
        var elm = Ext.get(elm);
        var href = elm.getAttribute('href');
        elm.set({href: "#", target: "", "data-href": href});
        Ext.get(elm).on('tap', function(event, node, options){
            var currentTarget = Ext.get(event.target);
            var url = currentTarget.getAttribute('data-href') || currentTarget.up('a').getAttribute('data-href');
            if (url) window.open(url, '_system');
        }, me);
    }, me);
}, 1000);

window.open(url, '_system');の利用は下記の方法で実装する必要があります。

端末のブラウザを利用する方法

以前qiitaに発表したページを参考

実装済みアプリ

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1