[Google Maps Library] Show a polygon on mobile maps

Forge Component
(20)
Published on 26 Feb by Labs
20 votes
Published on 26 Feb by Labs

Good Day,

I am trying to display a polygon or a linestring on my mobile maps application. I have the GeoJSON data but I don't know what to do with it. Can somebody point me in the right direction?

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            28.215939290821552,
            -25.86439827530633
          ],
          [
            28.212098367512226,
            -25.864765131222196
          ],
          [
            28.212184198200703,
            -25.865769152116027
          ],
          [
            28.216132409870625,
            -25.86540229931685
          ],
          [
            28.215939290821552,
            -25.86439827530633
          ]
        ]
      },
      "properties": {}
    }
  ]
}

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              28.21821380406618,
              -25.86607807990572
            ],
            [
              28.218621499836445,
              -25.869881687128085
            ],
            [
              28.221538485959172,
              -25.86957276928232
            ],
            [
              28.221141519024968,
              -25.86582707613811
            ],
            [
              28.21821380406618,
              -25.86607807990572
            ]
          ]
        ]
      },
      "properties": {}
    }
  ]
}

Thanks

Grant

Hi Grant McDonogh

Did you find the solution?

lizpaolagf wrote:

Hi Grant McDonogh

Did you find the solution?

Hi,

Sorry I missed your question. We did find a solution. Let me know if you still need help.


Grant McDonogh wrote:

lizpaolagf wrote:

Hi Grant McDonogh

Did you find the solution?

Hi,

Sorry I missed your question. We did find a solution. Let me know if you still need help.



How did you solve the problem?

Hi SaxoTom,

I think this component does not provide feature to draw polygon but you can use below component for the same

https://www.outsystems.com/forge/component-overview/6907/leafletjs-reactive

Thanks, but I couldn´t find a funktion like on this page: http://geojson.io/ 
here you can draw polygons and export them as a geoson file. This geojson file I could read with the plugin Leaflet Web plugin and draw in a map.


Hi SaxoTom,

I don't know if Leadflet plugin will be able to read geojso or not but you can use coordinates array from geojson and draw polygon using that array.

Nikhil Gaur wrote:

Hi SaxoTom,

I don't know if Leadflet plugin will be able to read geojso or not but you can use coordinates array from geojson and draw polygon using that array.

yes, Leaflet plug in can read geojson files. but I´m looking for a function like on this page: http://geojson.io. Here you can draw a polygon with many coordinates and export them to a geojson file. But you have to change all " into double "". Then it works. I´m looking for a function, which will be doing the same like geojason.io page.



Hi SaxoTom,

I think that you have to develop yourself as you won't find this kind of solution on forge. Atleast not at this time.