[OpenLayers-Users] angualjs and openlayers map in div. Somethings not right...

brett at mak.com brett at mak.com
Sat Mar 30 05:25:43 PDT 2013


Hi,

Anyone using angular and openlayers? I've got a problem... when I put an
openlayers map in a div and use ng-style to position it, the map doesn't
quite understand where it is and gets all messed up. Here's a plunker that
shows my problem:

http://plnkr.co/edit/5qaMIV

The code should put a marker at a simulated mouse click position of 100,100
(which should be in mexico). If you replace the map div that uses ng-style
with the map div that just uses a hardcoded style you will see the correct
expected result.

What's happening when I use ng-style? Is it overwriting some of openlayers
style stuff that tells openlayers about where on the page the map is? (Btw,
I had to use ng-show in order to call map.updateSize() which should tell the
map to calculate its new position.

Thanks,
Brett



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/angualjs-and-openlayers-map-in-div-Somethings-not-right-tp5043790.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list