openlayers-3

Using Bing Maps Quadkeys as Openlayers 3 Tile source

試著忘記壹切 提交于 2019-12-20 04:52:02
问题 I have a number of tile sources which utilise Bing Maps' Quadkey system in an old Silverlight application and I would like to use them in a new Openlayers 3 map. I have found several examples of functions which will convert these sources for Leaflet.js but the syntax is somewhat different for OL3 and reading through the API docs indicates that there is an ol.Tile.coord class but if I understand correctly this is an experimental feature and might require a custom build from the source code.

Openlayers-3 WFS-T (Post feature to postgis via geoserver)

﹥>﹥吖頭↗ 提交于 2019-12-18 17:11:53
问题 I have a problem with posting features from ol3 into postgis db via geoservers wfs.When i run this code, i only manage to insert gid(pk) and bin columns but the_geom(Geometry) column is empty. function addInteraction() { draw = new ol.interaction.Draw({ features: featureOverlay.getFeatures(), type: /** @type {ol.geom.GeometryType} */ (typeSelect.value) }); draw.on('drawend', function(evt) { var feature = evt.feature; feature.set('bin', 0); var fid = feature.getId(); var node = format

Openlayers-3 WFS-T (Post feature to postgis via geoserver)

﹥>﹥吖頭↗ 提交于 2019-12-18 17:11:16
问题 I have a problem with posting features from ol3 into postgis db via geoservers wfs.When i run this code, i only manage to insert gid(pk) and bin columns but the_geom(Geometry) column is empty. function addInteraction() { draw = new ol.interaction.Draw({ features: featureOverlay.getFeatures(), type: /** @type {ol.geom.GeometryType} */ (typeSelect.value) }); draw.on('drawend', function(evt) { var feature = evt.feature; feature.set('bin', 0); var fid = feature.getId(); var node = format

open layers 3 how to draw a polygon programmatically?

匆匆过客 提交于 2019-12-18 03:16:21
问题 How to draw a polygon use open layer 3 programmatically? i have a json array coordinate: [ { "lng": 106.972534, "lat": -6.147714 }, { "lng": 106.972519, "lat": -6.133398 }, { "lng": 106.972496, "lat": -6.105892 } ] and now i want to draw it on map use open layers. how to do it? 回答1: You need to use the ol.geom.Polygon constructor. That constructor expects an array of rings, each ring being an array of coordinates. In your case this is how you will create the polygon (this assumes your array

How can I use a SVG image as layer on OpenLayers-3

心已入冬 提交于 2019-12-17 18:23:10
问题 How can I use a SVG image as a Layer (so not as a map marker) with OpenLayers-3 I was unable to get any output of my SVG image when using any of the ol.source.Vector and ol.format.Feature instances. Small example: var mapLayer = new ol.layer.Vector({ source: new ol.source.Vector({ url: 'image.svg', format: new ol.format.Feature() // http://openlayers.org/en/v3.12.1/apidoc/ol.format.Feature.html }), }); I was able to get output when using the ImageStatic layer, but this uses/generates(?) a

Ionic 2 Beta and Open Layers 3 not loading map

馋奶兔 提交于 2019-12-13 15:02:05
问题 I have try to create a test project for use Open Layers 3 with the new ionic 2 but it isn't work This is my layout: <ion-navbar *navbar> <button menuToggle> <ion-icon name="menu"></ion-icon> </button> <ion-title>Mappa</ion-title> </ion-navbar> <ion-content padding class="map-page"> <div id="map" class="map"></div> </ion-content> And this is my controller: import {Page} from 'ionic-angular'; @Page({ templateUrl: 'build/pages/map/map-page.html' }) export class MapPage { constructor(){ this.test

Vector labels get cutted since new ol-version (3.12.1) and VectorTile layer

╄→尐↘猪︶ㄣ 提交于 2019-12-13 14:08:30
问题 Since i upgraded my application to ol.3.12.1 from ol.3.9.0 and implemented the new VectorTile Layer and Source i got some normal but bad rendering behaviour. The problem is that labels which are intersecting the tileborders get cut off. I looked ate the Sourcecode but i found no possibility to set an option, like partials or overlap like in other libaries which are working with tiles (mapserver or e.g). Does anyone know a Workaround? I looked at the pull request and it doesn't seem to be an

Loading source vector (Features won't show?)

狂风中的少年 提交于 2019-12-13 07:01:50
问题 I have a function that loads a vector source from a local geojson file. Problem is, I need it to be remote for one of the layers, yet the features never show despite loading the source properly and the console.logs showing me it did indeed fetch them...plus a weird thing happens if I omit the line: "this.layerSwitcherGroup.getLayers().push(this.pointsLayer);" from the code. When that line is commented, the loader never runs (no console.logs appear from inside it). Note: I am editing the crs

OpenLayers onmousedown load image

我是研究僧i 提交于 2019-12-13 06:44:55
问题 I was looking at this example of openLayers ( http://openlayers.org/en/v3.14.1/examples/custom-interactions.html?q=custom ) and I was wondering how can I load a small image like the one in the example on mouse down on the map? I tried several things but couldn't figure it out. Any ideas? Thanks! 回答1: The example you link to uses custom interactions to drag existing features around the map - this code is very useful and I used it to work out how to drag markers around my map. However, there is

how to get the ray of a circle in meters using getRadius()

ぐ巨炮叔叔 提交于 2019-12-13 05:57:06
问题 the method getRadius() of class ol.geom.Circle returns the radius of a circle ; how can I convert this value into meters ? I draw a circle on a map using a particular projection (e.g Spherical Mercator, LambertIIe, etc.) then I convert this geometry into degree to process further treatments such as testing if a point (in degrees) is inside this circle so getting the radius always in the same unit (meter) from a geometry in degree would be useful thanks in advance Jean-Marie 回答1: You can use