This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Handle Polygon to google from Postgis. #110
Comments
maurocrispin21
changed the title
Handle MultiPolygon to google from Postgis.
Handle Polygon to google from Postgis.
Apr 3, 2018
I could not find a proper way to do it. So I dumped geom into points then I used ST_X ST_Y to get points' lat/lon |
I solved a similar issue when generating polylines. Model:
Controller:
View:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I need to render polygons on google maps using this library.
I store my cordinateds as geomtry data type on postgis postgres [https://postgis.net/docs/geometry.html]. So my coordinates are not a human readable latlong array. Geometry data type cannot be handle due this library recieves arrays to define polygons
`$coords = [
new LatLng(['lat' => 25.774252, 'lng' => -80.190262]),
new LatLng(['lat' => 18.466465, 'lng' => -66.118292]),
new LatLng(['lat' => 32.321384, 'lng' => -64.75737]),
];
Geometry data type has different data type outputs https://postgis.net/docs/reference.html#Geometry_Outputs.
One of that outputs is GeoJSON https://postgis.net/docs/ST_AsGeoJSON.html. That actually google maps api can manage according with google's api doc https://developers.google.com/maps/documentation/javascript/datalayer#load_geojson
How can I handle this type of data to yii2-google-maps-library???
The text was updated successfully, but these errors were encountered: