-
Notifications
You must be signed in to change notification settings - Fork 327
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
dynamic loading of vector data #171
Comments
Hi @FizrukBet, I see no reason why it would not work. As soon as a new feature is added, an event is emitted from ol3 and we create the 3D counterpart immediately. |
when I move a 2D view, all ok. But I want to load data when I move a 3D view. I don't know how to initiate an event to load data from server by extent, when i move 3d view. |
I understand now.
The more you are tilted, the larger the viewed area.
You may try modifying the loading strategy to take into account the tilt
and the distance of the camera.
Do you have zoom levels of your data?
Even in 2D, how do you handle displaying a large area?
|
"The more you are tilted, the larger the viewed area" - it's a second problem. now, when I change 3d view vector data aren't loaded at all |
In stacked views, when the 3D globe is displayed, the 2D map is not rendered.
You can check using side-by-side views that it solves you first issue.
|
if I use side-by-side all ok |
i need to trigger event of load data when 2d view is disabled. |
This could be related to the second point at #346. My workaround as of now is, after the load of the vector layer (in my case from a kml file), to switch to 2d view and back to 3d (#346 (comment)). On the brief time that the map is in 2d, the vector layer is loaded, and is available once I am back in 3d. The only drawback is that there is a flicker due to this switch. |
in ol3 i'm using dinamic loading of vector data from geoserver:
var vectorLoader = function(extent, resolution, projection) {
var url = 'http://localhost:8088/geoserver/wfs?service=WFS&' +
'version=1.1.0&request=GetFeature&typename=three:build_3_3857&' +
'outputFormat=text/javascript&format_options=callback:loadFeatures' +
'&srsname=EPSG:3857&bbox=' + extent.join(',') + ',EPSG:3857';
$.ajax({
url: url,
dataType : 'jsonp'
});
};
var loadFeatures = function(response) {
var features = vectorSource.readFeatures(response);
vectorSource.addFeatures(features);
};
var vectorSource = new ol.source.ServerVector({
format: new ol.format.GeoJSON(),
loader: vectorLoader,
strategy: ol.loadingstrategy.bbox
});
var vector = new ol.layer.Vector({
source: vectorSource,
style: style
});
Сan i synchronize this data with 3d view? I want to load vector data when i changed a 3d view.
Maybe I have to use other strategy?
The text was updated successfully, but these errors were encountered: