-
Notifications
You must be signed in to change notification settings - Fork 98
Angular Universal and openlayers #108
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
Comments
I'm sure to fully understand what you're trying to achieve. Could you be more specific? |
I mean Angular Universal/. If I run app through angular-cli (ng serve), app is build and run. But if i trying to run Angular Universal show exception "window is not define", because openlayers use window(or document) for rendering map, but Angular Universal doesn't allow use widow(or document) |
Thanks for the information. I suggest you submit an issue in the Openlayers repo then (since the exception occurs in their code). Regarding this, I'm also in favour of letting the developer provide a replacement image in such case, i.e. if the map cannot be instantiated, provide a static image in place of the map. This could be done that way: <aol-map [alt-img]="path_to_img">
</aol-map> That should allow for server side rendering. |
I'm trying to insert a static picture, but I throw an error:
|
Hey @Phreeman703, the above code was a mock-up, a proposal on the way to let user achieve this. |
oh... @quentin-ol, i wasn't understood that is mock-up(( I found the solution with window. In server.ts need mock-up global['window'] = win and use domino
but the solution led to another error. Can not use 'in' operator to search for 'geolocation' in undefined. Soree all this happens, because they made a mock-up 'window' |
Please let me know if you found a solution for this. |
@AbdallahAbdedaiem there is a solution there submitted by a developer => #202. But the Pull Request is still not merged after two years @quentin-ol are you alive ? lol. |
I have a Angular 4 Universal app and i use openlayers. If i run app with client-side app work, but if i try run app with server side render, i caught an exception "window is not define".
The text was updated successfully, but these errors were encountered: