Please create and activate an account. Afterwards send an email to forum@openseamap.eu including a short message and your username to get write access to this forum. Thanks!
Bitte erstelle einen neuen Account und schalte ihn frei. Anschließend sende eine kurze Mail mit deinem Nutzernamen an forum@openseamap.eu um Schreibzugriff für dieses Forum zu bekommen. Danke!
This server undergoes periodic maintenance and will be unavailable for a few minutes between 00:00 UTC and 01:30 UTC at the first day of the month. New posts during that time could potentially be lost.
Dieser Server wird regelmäßig gewartet und ist deshalb für einige Minuten zwischen 00:00 UTC und 01:30 UTC am Monatsanfang nicht erreichbar. Es kann sein, dass in dieser Zeit erstellte Beiträge verloren gehen.
You are not logged in.
Pages: 1
Hello, I'm starting in Openlayers and I'm having a problem visualizing polygons on maps.
I have a set of polygons being returned from a query in the database (postgres / postgis) this set of polygons is passed via json by an ajax request to the frontend where I intend to use the OpenLayers3 library to display those polygons on a map.
Return example as KML:
{st_askml=<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-53.460269936027402,-24.954734829872194 -53.460072335178054,-24.954744520125182 -53.460093771307605,-24.955104793997403 -53.460291372725941,-24.955095103672289 -53.460269936027402,-24.954734829872194</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>}
{st_askml=<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-53.459896169834188,-24.955114484062349 -53.459874734273619,-24.9547542101181 -53.459701833437066,-24.954762688648493 -53.459723268499758,-24.955122962655768 -53.459896169834188,-24.955114484062349</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>}
What would be the best way to create the vector layer with these polygons using OL3?
Saving the set of polygons in a file and using this file as source for the layer?
Using json itself as source for the layer? (Is there such a possibility?)
And how would the syntax of this layer look in OL3?
Offline
Pages: 1