I am using angular.js and angular-openlayers-directives to make a simple map, Now i saw this simple example online HERE.
Now i just wanted to modify the code, to add an extent so that layers beyond a certain dimension would not be loaded, so my code looks as follows:
var coordinate1, coordinate2,coordinate1 = ol.proj.fromLonLat([77.6013, 12.9044]),coordinate2 = ol.proj.fromLonLat([77.6885, 12.9536]),latlon = ol.proj.fromLonLat([77.6244159, 12.9370699]);app.controller('DemoController', [ '$scope', function($scope) { angular.extend($scope, { quebec: { lat: latlon[0], lon: latlon[1], zoom: 5 }, bing: { extent:[coordinate1[0], coordinate1[1], coordinate2[0], coordinate2[1]], source: { name: 'Bing Maps', type: 'BingMaps', key: 'Aj6XtE1Q1rIvehmjn2Rh1LR2qvMGZ-8vPS9Hn3jCeUiToM77JFnf-kFRzyMELDol', imagerySet: 'Road' } } });} ]); See how i am generating the coordinates:
var coordinate1, coordinate2,coordinate1 = ol.proj.fromLonLat([77.6013, 12.9044]),coordinate2 = ol.proj.fromLonLat([77.6885, 12.9536]),latlon = ol.proj.fromLonLat([77.6244159, 12.9370699]);and using them in the following fashion :
quebec: { lat: latlon[0], lon: latlon[1], zoom: 5 } and also here:
extent:[coordinate1[0], coordinate1[1], coordinate2[0], coordinate2[1]]Now this does't work , if i remove the extent parameter , i realize the map is somewhere in the Arabian sea, which is not the coordinates i have specified. So Where am i going wrong here and how do i specify extent using the angular-openlayers-directive ?
The example i have created can be seen HERE
أكثر...
Now i just wanted to modify the code, to add an extent so that layers beyond a certain dimension would not be loaded, so my code looks as follows:
var coordinate1, coordinate2,coordinate1 = ol.proj.fromLonLat([77.6013, 12.9044]),coordinate2 = ol.proj.fromLonLat([77.6885, 12.9536]),latlon = ol.proj.fromLonLat([77.6244159, 12.9370699]);app.controller('DemoController', [ '$scope', function($scope) { angular.extend($scope, { quebec: { lat: latlon[0], lon: latlon[1], zoom: 5 }, bing: { extent:[coordinate1[0], coordinate1[1], coordinate2[0], coordinate2[1]], source: { name: 'Bing Maps', type: 'BingMaps', key: 'Aj6XtE1Q1rIvehmjn2Rh1LR2qvMGZ-8vPS9Hn3jCeUiToM77JFnf-kFRzyMELDol', imagerySet: 'Road' } } });} ]); See how i am generating the coordinates:
var coordinate1, coordinate2,coordinate1 = ol.proj.fromLonLat([77.6013, 12.9044]),coordinate2 = ol.proj.fromLonLat([77.6885, 12.9536]),latlon = ol.proj.fromLonLat([77.6244159, 12.9370699]);and using them in the following fashion :
quebec: { lat: latlon[0], lon: latlon[1], zoom: 5 } and also here:
extent:[coordinate1[0], coordinate1[1], coordinate2[0], coordinate2[1]]Now this does't work , if i remove the extent parameter , i realize the map is somewhere in the Arabian sea, which is not the coordinates i have specified. So Where am i going wrong here and how do i specify extent using the angular-openlayers-directive ?
The example i have created can be seen HERE
أكثر...