小编Aad*_*101的帖子

使用Ionic 3在地理位置中的拖动标记后获取位置(纬度和经度)?

我正在使用Ionic 3中的Geoge-location插件。一切正常,但是我需要添加一个可拖动的标记并获取该标记的位置。我是离子的新手。我搜索了此链接,却发现链接很少,但运气不好实现

链接:拖动标记位置示例

https://www.joshmorony.com/ionic-2-how-to-use-google-maps-geolocation-video-tutorial/

YouTube教程 https://www.youtube.com/watch?v=vhVwCZlqIL4

Github链接 https://github.com/Aadencoder/Ionic-3-Angular-Google-Maps-API-

Home.ts

import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { Geolocation } from '@ionic-native/geolocation';

declare var google: any;

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  map: any;
  markers: any;

  establishments = [{
    name: 'Biratnagar',
    lat: 26.4525,
    lng: 87.2718
  }, {
    name: 'Biratnagar',
      lat: 26.7944,
      lng: 87.2718
  }]
  constructor(public navCtrl: NavController, public geolocation: Geolocation, private platform: Platform) {

  }

  ionViewWillEnter(){
    this.platform.ready().then(() => { …
Run Code Online (Sandbox Code Playgroud)

google-maps geolocation google-maps-api-3 ionic-framework angular

5
推荐指数
1
解决办法
996
查看次数

多语言@ ngx-translate Ionic 3 Object(...)不是TranslateService.get的函数吗?

我想实现多语言功能。我遵循了https://ionicframework.com/docs/developer-resources/ng2-translate/。但是我得到Object(...)不是TranslateService.get错误的函数

我已经在Google搜索此错误,但是没有运气。我遵循了这个https://codesundar.com/lesson/ionic-multi-language-support-i18n/

这是代码

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';

import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClientModule, HttpClient } from '@angular/common/http';

// If I use this I get error …
Run Code Online (Sandbox Code Playgroud)

multilingual ionic-framework angular

2
推荐指数
2
解决办法
1848
查看次数