openlayers-3

Openlayers 3 GeoJSON coordinates shows wrong result

让人想犯罪 __ 提交于 2020-01-05 09:49:00
问题 I am using angular-openlayers-directive to build my project. I try to rewrite the example of geojson part cause I will get point information dynamically. So I made the source part of geojson inside instead of loading from json file. However, the position of my code is totally different as I expect. The result suppose to show a point at that coordinate I set. But the point is like at the [0, 0]. If I change the to use loading from the json file, that will work. I have no idea why the

Openlayers 3 GeoJSON coordinates shows wrong result

邮差的信 提交于 2020-01-05 09:47:28
问题 I am using angular-openlayers-directive to build my project. I try to rewrite the example of geojson part cause I will get point information dynamically. So I made the source part of geojson inside instead of loading from json file. However, the position of my code is totally different as I expect. The result suppose to show a point at that coordinate I set. But the point is like at the [0, 0]. If I change the to use loading from the json file, that will work. I have no idea why the

Display multiple WFS layers with popup

心不动则不痛 提交于 2020-01-05 05:36:25
问题 I want to display multiple WFS layers and display popup only for top layer. I wan't to disable all the base layer popup. Or if i wan't to display one features from all the layer (combine all layer features in one popup ).I have done some code but i don't understand how to add popup for one layer or popup for all layer but display only selected feature in one popup.This is my code , document.addEventListener('DOMContentLoaded',function(){ var container = document.getElementById('popup'); var

openlayers 3 get layer for selected feature

我们两清 提交于 2020-01-05 03:33:58
问题 I'm trying to get the "id" of the layer for a selected feature and have tried maybe 3 or 4 methods for achieving this but have yet to achieve it. I add my features like this... angular.forEach(response.FieldList, function (Field, key) { if (Field.FieldID != "") { var shape = response.FieldList[key].Shape; shape = shape.replace('}', ',"id":' + '"' + Field.FieldID + '"' + '}'); var geoJsonObj = { 'type': 'Feature', 'geometry': JSON.parse(shape), 'name': Field.FieldID, 'id': Field.FieldID } var

openlayers3 wfs-t save drawing

流过昼夜 提交于 2020-01-04 08:07:10
问题 I'm workin on an OL3 app, where the user will be able to draw, modify and delete polygons and save the changes to GeoServer via WFS-T. For starting point I've used the solution from here: wfs-t example app I've changed the code a little bit to use a polygon layer from my GeoServer. The draw, modify and delete polygon functions are working great, if I modify or delete a polygon it's also saved, but the new polygon creation is not saved and I can not figure out why. The original app is working

view.fit() using view.animate() in OpenLayers 3.20+

送分小仙女□ 提交于 2020-01-04 07:34:12
问题 I have the following code, written for OpenLayers pre 3.20: fitViewToFeature: function (viewer, feature) { var pan = ol.animation.pan({ source: viewer.olView.getCenter(), duration: 1000 }) var zoom = ol.animation.zoom({ resolution: viewer.olView.getResolution(), duration: 1000 }) viewer.olMap.beforeRender(pan, zoom) viewer.olView.fit(feature.getGeometry(), viewer.olMap.getSize(), { padding: [ 100, 100, 100, 100 ], constrainResolution: false, maxZoom: 4 }) } My question is how to translate

Show GeoTiff image Openlayers 3

情到浓时终转凉″ 提交于 2020-01-04 05:01:48
问题 I need to display a raster image in GeoTiff format, it was georeferenced with QGIS. It looks like Openlayers 3.15 doesn't support this kind of format. Do you know anything about that? var agentUrl = 'http://localhost:9925/Wgis/assets/img/allertaMeteoGeo.tif'; var bounds = [ 713101.704, 4044061.027, 713101.704, 4044061.027]; var view2 = new ol.View({ center : [ -87.7302542509315, 43.744459064634 ], projection : "EPSG:3857", zoom : 12 }); var sorgente = new ol.source.ImageMapGuide({ projection

Show GeoTiff image Openlayers 3

回眸只為那壹抹淺笑 提交于 2020-01-04 05:01:04
问题 I need to display a raster image in GeoTiff format, it was georeferenced with QGIS. It looks like Openlayers 3.15 doesn't support this kind of format. Do you know anything about that? var agentUrl = 'http://localhost:9925/Wgis/assets/img/allertaMeteoGeo.tif'; var bounds = [ 713101.704, 4044061.027, 713101.704, 4044061.027]; var view2 = new ol.View({ center : [ -87.7302542509315, 43.744459064634 ], projection : "EPSG:3857", zoom : 12 }); var sorgente = new ol.source.ImageMapGuide({ projection

Fire an event when draw finishes and new polygon is added to the features list in openlayers 3

余生长醉 提交于 2020-01-03 20:05:10
问题 I am trying to create an interactive map with OpenLayers 3, where the client can draw polygons on the map, and then retrieve the coordinates of the polygons which were drawn. I've found a nice little tutorial on CodePEN , which I am using for the draw interaction. Here's the code I use to draw a new polygon on the map: var curMap = this; this.draw_interaction = new ol.interaction.Draw({ source: this.vectorLayer.getSource(), type: /** @type {ol.geom.GeometryType} */ ('Polygon') }); this.map

Proj4Leaflet reprojection like in openlayers

梦想的初衷 提交于 2020-01-03 19:06:38
问题 I try to display several layers in own projections on base map also in it's own projection Below my working example implemented using OpenLayers + proj4 library var projection_name = 'EPSG:32610'; proj4.defs(projection_name, "+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"); var proj = ol.proj.get(projection_name); var my_custom_layer = new ol.layer.Tile({ opacity: 0.5, source: new ol.source.XYZ({ url: '', projection: proj, }) }); var osm_layer = new ol.layer.Tile({ source: new ol.source