Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<aol-overlay> can't getPosition #263

Open
cesarbenjamindotnet opened this issue Jan 27, 2021 · 3 comments
Open

<aol-overlay> can't getPosition #263

cesarbenjamindotnet opened this issue Jan 27, 2021 · 3 comments

Comments

@cesarbenjamindotnet
Copy link

Hello, i have a lot of days dealing with this:

i have a few weeks working with this library, all seems going well, but now i have to show some info i got from wms server. i'm trying to use with this code:

`<aol-overlay *ngIf="WMSInfo.mostrar" #popupOverlay [autoPan]="true">
<aol-coordinate
[x]="clickCoord4326[0]"
[y]="clickCoord4326[1]"
[srid]="'EPSG:4326'"
>

                <aol-content>
                    <div #popupInfo class="ol-popup">
                        <a (click)="quitarPopupInfo()" #popupCloser class="ol-popup-closer"></a>
                        <div id="popup-info-content">
                            <p [innerText]="clickCoord4326"></p>
                            <div *ngFor="let info of WMSInfo.contenido">
                                <div>{{ info.nombre }} {{ info }}</div>
                                <hr>
                            </div>
                        </div>
                    </div>
                </aol-content>
            </aol-overlay>`

but when i test the app, i got an error in console about of this.host.instance is undefined

ERROR TypeError: this.host.instance is undefined
ngOnChanges coordinate.component.js:45
Angular 6
MapaViewComponent_aol_layer_tile_42_aol_source_tilewms_1_aol_overlay_2_Template mapa-view.component.html:222
Angular 42
RxJS 5
Angular 17
RxJS 22

seems something is not coming well to coordinate.component.js:45 but i cant find why or what :(

can you check this please?

i have angular 10, btw

@Shaurya-Yay
Copy link

I am facing the same problem after upgrading angular version from 9 to 10 and then 11.
Cannot read property 'setPosition' of undefined
at CoordinateComponent.ngOnChanges (coordinate.component.js:49)

@peterrauch88
Copy link

Is there a solution for this problem? After upgrading the angular version, I got the same message.

@peterrauch88
Copy link

adding peerDependencies to package.json solved my problem
"peerDependencies": {
"@angular/common": ">=6.0.0 <=10.x.x",
"@angular/core": ">=6.0.0 <=10.x.x",
"ol": "^6.0.0"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants