Hello CSPro Users,
I have and application in which I need it to open a map and draw a polygon depending on the offline file saved in the device. I have an file named ea.geojson, after opening a satellite map, the application should be a able to draw that EA boundary according to the ea.geojson file.
I have tried it bu it does not work, maybe if I put logic here and tell me guys what went wrong
mymap.setBaseMap(Satellite);
geometry boundary;
boundary.load("./Maps/ea.geojson");
numeric geometryId = mymap.addGeometry(boundary);
mymap.show();
Staellite map opens successful but it does not show the EA boundary, loaded from thr geojson file.
Any help please, what is wrong is my syntax?
Thanks in advanced
Drawing a Geometry Polygon using a geojson file
-
- Posts: 79
- Joined: August 17th, 2015, 9:32 am
- Location: Dar es Salaam, Tanzania
Drawing a Geometry Polygon using a geojson file
Munir Mdee
Software Programmer
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com
Software Programmer
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com
Re: Drawing a Geometry Polygon using a geojson file
I used your logic and it worked. I would verify the path to the geojson file and make sure the load succeeds. Then I would verify there isn't an issue with the geojson file. My suggestion would be to generate a new one using the Geometry example for your current location. Then display a map for your current location and load the geojson using your provided logic.
-
- Posts: 79
- Joined: August 17th, 2015, 9:32 am
- Location: Dar es Salaam, Tanzania
Re: Drawing a Geometry Polygon using a geojson file
Hi Aaron, maybe there is a problem with the geojson file, although I created it with QGIS, I there a sample geojson file that I can use to test?
Munir Mdee
Software Programmer
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com
Software Programmer
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com
-
- Posts: 1839
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Drawing a Geometry Polygon using a geojson file
Attached is a GeoJSON file showing the location of the Census Bureau.
- Attachments
-
- Census Bureau.geojson
- (211 Bytes) Downloaded 92 times