Open Fatalityap opened 6 years ago
I had exactly the same scenario. The answer is that you have openlayers, since it is installed as a dependency of ngx-openlayers.
Just add this line to the top of your TS file:
import * as ol from 'openlayers';
Then you can use ol.proj.transform
I'm not sure whether you can save on memory by importing only select parts of openlayers.
Thanks )
Hi, I am a little bit new to Angular2(3,4,5,6) I have created map click event handler and I can receive coordinates via event.coordinate but how can I transform it to EPSG:3857 ?
In raw javascript I can do like this
ol.proj.transform(event.coordinate, 'EPSG:4326', 'EPSG:3857')
but this is not working for me.Here is part of my code:
html code here:
How can I do it?
How can I even have access to ol object? Maybe I need to import something?
Can you help me?