Questions tagged [typescript]
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript
41
questions
0
votes
0
answers
24
views
needs to select at least one form-control in the set of form-controls [closed]
I have form like below :
ngOnInit() {
this.configGroup = new FormGroup({
accountOne: new FormControl(null),
accountTwo: new FormControl(null),
...
3
votes
2
answers
74
views
Multiply line using style in OpenLayers
I'm working on a map application, where I should display multiple routes, each with its own name and coloring. In some locations, there are multiple routes following the same path.
Is there a way to ...
0
votes
0
answers
38
views
Getting color of selected LineString in OpenLayers?
I have a dynamically generated layers of LineStrokes which get their color from the API call. I only have a basic style for them, to which a color is set when I receive data from API and each layer ...
3
votes
0
answers
72
views
Split an array of GeoJSON linestrings (from Overpass Turbo) into an array of road intersections
I've got a query that pulls in a bbox of GeoJSON LineStrings representing roads from the Overpass Turbo API. I'm working in Typescript and have been using the TurfJS library extensively.
I want to ...
0
votes
2
answers
91
views
Handle only last event in OpenLayers map zooming [duplicate]
I have an application using OpenLayers 6 where I am listening to map.getView().on('change:resolution', ...).
When the user zooms with the scroll wheel on the mouse, my handler gets blasted with dozens ...
0
votes
0
answers
132
views
OpenLayers and rotating feature with Modify interaction
I am trying to implement feature rotation in my project. So far I have added select interaction, to select feature that needs to be rotated, and pass it to function, that contains almost all the code, ...
1
vote
0
answers
100
views
@turf/boolean-contains returns false, even though one polygon is fully contained in another
I'm having trouble with some polygons.
I'm using BooleanContains from the turf library to try to highlight some errors in my map. The thing is that in some polygons BooleanContains acts weird. For ...
1
vote
2
answers
261
views
Converting Turf Polygon to Leaflet Polygon
I'm using Geoman and Turf to handle polygons on my map. In order to add a new functionality, I have to transfer an element from a function where it's typed as a Turf Polygon to another function which ...
1
vote
0
answers
175
views
DefinitivelyTyped nominatim search result type?
When I use a query like this:
https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1
(from https://nominatim.org/release-docs/develop/api/...
0
votes
0
answers
304
views
OpenLayers 7, Angular - How to show GeoTIFF on map at right location?
In OpenLayers 7, I am trying to show the content of a GeoTIFF file on a map within an Angular 14 Web application. Even though I am able to create a layer out of the GeoTIFFSource without error, the ...
0
votes
1
answer
660
views
How to rotate custom marker in Mapbox
I'm using a custom marker with Mapbox-gl for web, and at the same time, I expect to rotate the cursor to follow the line created with the latitude and longitude.
this.mapa = new mapboxgl.Map({
...
0
votes
1
answer
756
views
Leaflet marker not added to the map after click event on div element
I am trying to add a marker after performing a search, at a specific location given latitude and longitude.
For some reason, the browser runs the code but does not add the marker to the map.
//...
1
vote
1
answer
316
views
Error Handling Geoprocessing Service in ArcGIS JavaScript API
I am using ArcGIS JavaScript API 4.21 (with TypeScript). @arcgis/core/tasks/Geoprocessor is deprecated since version 4.20. So I am using @arcgis/core/rest/geoprocessor instead.
import JobInfo from &...
1
vote
0
answers
803
views
Only get pointermove event from OpenLayers when mouse button is pressed
I'm trying to get hover position with 'pointermove' event from OpenLayers Map.
const source = new OlXYZ({
url: 'https://tile.osm.org/{z}/{x}/{y}.png'
});
this.layer = new ...
2
votes
1
answer
250
views
ArcGIS API GraphicsLayer is not visible on map
I'm creating an onClick eventhandler to create a point on every click on the map, but the Graphics layer is not visible;
Has anyone else encountered this? Is there something special I'm supposed to do ...
2
votes
1
answer
464
views
Generate list of legend's RGB colors and values in ArcGIS
I am writing a node/typescript app that analyzes raster data. It uses leaflet and esri-leaflet quite a bit (modified to work server-side). For a given map bounds, it can download a raster image from ...
0
votes
1
answer
303
views
Unable to insert geometry point using TypeScript and MassiveJS
I am trying to simply trying to validate a point before I actually insert it into the db.
I am using the following:
TypeScript: 3.5.2
MassiveJS: 6.4.0
PostgreSQL: 11
PostGIS: 2.5
const ...
1
vote
1
answer
774
views
How to get the co-ordinates of the clicked point using 'ol/Draw' in OpenLayers 6?
I am trying to create a measure tool using OpenLayers 6. I did get examples to measure distance and area using the ol/Interaction/Draw and ol/geom library classes. I want also to measure the ...
2
votes
1
answer
1k
views
How to unset an event listener in OpenLayers 6?
I am trying to use '.un' to unset the 'single-click' event listener. I have tried all the ways available. How can I do this?
measurePoint() {
const that = this;
this.mapObj.on('singleclick', (e) =...
1
vote
1
answer
1k
views
Smooth line animation on map
I tried to produce a smooth line animation with below code. How can I do this?
I used OpenLayers with Angular. It works as a drawing line but I want more smooth movement something like this (http://...
1
vote
0
answers
81
views
Add custom types typescript 3
The current behavior: I migrated from @types/openlayers": "4.6.17" to "@types/ol": "5.3.6" and I don't find the function getVectorContext(event) in ol/render so I added it manually to render.d.ts but ...
1
vote
0
answers
573
views
Draw and GeometryFunction (OL5 - Typescript)
I'm trying to update my OL3 code (javascript) in OL5 (typescript) and I don't know how to fix this "GeometryFunction". Do you know how to build the GeometryFunction object?
var myDraw = new Draw({
...
0
votes
0
answers
2k
views
How to render values onClick() event in componentDidMount()
I am using OpenLayer library and I need change values in ComponentDidMount() but when I am clicking it does not affect. I have used forceUpdate().
handleDisable = () => {
this.setState({ ...
1
vote
0
answers
1k
views
OpenLayers getText() from style function
I have a feature with a label set via feature.style.text. In my unit tests, I need to grab the value of the label.
Normally I would use getStyle().getText().getText(). However, in the example below ...
6
votes
2
answers
4k
views
Using OpenLayers 5.3 in TypeScript without Node.js
I would like to use the latest version of OpenLayers (5.3) in small project. The requirements are:
no Node.js - I will be running thing on the site hosted on IIS, simple HTML files
scripts need to be ...
2
votes
1
answer
4k
views
Map container is already initialized
In Leaflet, I want all my markers to be hidden at the same time and show on the click of a checkbox.
Here is my code:
var cordnt=this.coordinates;
var overlayMarker = {};
console.log("testing ...
1
vote
0
answers
684
views
Getting ArcGIS API for JavaScript to work in Typescript application using Webpack?
I am trying to incorporate the arcgis-js-api into an Angular2/Typescript application I am developing in Visual Studio 2017 using Webpack. I have not been successful in getting it work.
I've gone ...
1
vote
0
answers
217
views
WFS typescript/angular 4
Is there a WFS library that will work with typescript or angular 4
I would like the access a WFS server without showing a Map on the page so I dont think openlayers will work for me.
2
votes
0
answers
629
views
OpenLayers with TypeScript events
I'm getting some problems using openlayers with TypeScript, there are some errors in the .on use, can you help me giving some tips?
Argument of type '(event: Event) => void' is not assignable to ...
1
vote
0
answers
806
views
Feature is undefined when click on map
I try to get feature from map that I add route and marker already but when I click at it. I get nothing from it. Do I miss something? I used typescript(angular 4)
this is map declare:
ngOnInit() {
...
1
vote
1
answer
4k
views
"L.Proj is undefined" error when using Proj4Leaflet in Angular 5
I am facing the error "ERROR TypeError: Cannot read property 'CRS' of undefined" caused by L.Proj being undefined.
Here what I did :
I added Leaflet, Proj4 and Proj4leaflet packages using npm ...
2
votes
1
answer
818
views
OpenLayers setMap function is removing controls I have added
I'm trying to extent Ol.Control with my own controls, like this:
class ZoomHistory extends ol.control.Control {
constructor(opt_options) {
var options = opt_options || {};
...
2
votes
0
answers
522
views
Openlayers 4 - Load WMS image source require authentication
I try to load WMS image layer with openlayers 4.6 and angular 5, the code is:
const syr_layer = new ol_layer_Image({
source: new ol_source_ImageWMS({
url: 'serverurl', crossOrigin: 'anonymous'...
1
vote
2
answers
1k
views
OpenLayers 4 - Preserve geometry shape when modifying
Using the ol.Draw interaction and ol.interaction.Draw.createBox() geometry function we can draw a regular rectangle:
let geomFunction = ol.interaction.Draw.createBox();
let draw = new ol.interaction....
0
votes
1
answer
3k
views
openlayers 4 cannot add vector source
I'm trying to add a vector layer from vector source , but getting error like this
AppComponent.html:1 ERROR TypeError: this.adaptAttributions_ is not a function
at Object._ol_source_Source_ (...
1
vote
1
answer
3k
views
How to replace the leaflet-draw toolbar by buttons outside the mapDiv
I did quit research to move the bar out of the leaflet map.
So what I did basically is that I created 3 buttons outside the map Div:
Draw Polygon
Delete
Edit
I binded events to the draw Polygon ...
2
votes
1
answer
3k
views
Animate marker in OpenLayers 3
I have been trying to find a marker animation plugin for OpenLayers to sync lat, lon, and time data along a track like this (in Leaflet):
http://leafletplayback.theoutpost.io/examples/example_2.html
...
4
votes
3
answers
8k
views
How to filter a vector layer in openlayers?
I'm using openlayers (v3.20.0) in an angular 2 project.
I have a vector layer which has its source bound to a geoserver.
My task is to filter the features displayed in this layer. I have a ...
1
vote
0
answers
1k
views
cannot append a featureCollection in typescript
I have the following interfaces:
export interface Feature<T extends GeometryObject> extends GeoJsonObject
{
type: 'Feature'
geometry: T;
properties: any;
id?: string;
}
export ...
1
vote
0
answers
736
views
OpenLayers change:rotation not called
I am using ol-cesium and I want to receive an event when the map is rotated. So my approach is to use the change:rotation event of the ol.Map, but it is never called.
this.map = new ol.Map({
...
3
votes
0
answers
1k
views
OpenLayers and Ionic 3 | tileLoadFunction not working
I am building a simple map app with the Ionic 3 framework. I am using OpenLayers 4.0.2 as the map api.
It has been going great until I tried implementing a custom tileLoadFunction for the basemap ...