GeoJSON without javascript object - can InfoWindow be drawn? - google-maps

I'm wondering if an InfoWindow (or similarly rich component) can be handed to a Google Map within the GeoJSON itself as a "feature", or "shape", etc.
(I'm working in an environment where I don't have access to the google.maps.Map object, but I do have access to the GeoJSON that is rendered on the map.)
In other words, is something like this possible?:
{
"type": "FeatureCollection",
"features": [
{
"type":"Feature",
"properties":
{
"strokeColor":"#00FF00",
"strokeWeight":4,
"strokeOpacity":1
},
"geometry":
{
"type":"LineString",
"coordinates":
[
[-150.6339948,64.98646889999999],
[-147.8560028,64.81510162]
]
}
},
{
"type":"Feature",
"properties":
{
"content":"testing testing",
"minWidth":100
},
"geometry":
{
"type":"InfoWindow",
"coordinates":
[-150.6339948,64.98646889999999]
}
}
]
}
Thanks in advance for your time!

Related

Delete coordinates in leaflet geojson

I have a leaflet geojson layer:
var geojsonlayer = L.geoJson({
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[0,0],
[1,1],
[2,2]
]
}
}
]
}).addTo(map);
How is it possible to delete a coordinate or multiple coordinates (and apply such changes to map)?

Flutter: Unexpected character (at character 1)

In Flutter, no matter what json file i try to decode I get the same above titled error.
Originally I thought it was something with my project but after starting a new template Flutter project I still receive the same error. I have the json file in my root folder and have added them to the pubspec.yaml file:
assets:
- Sample-JSON-data.json
- Sample-employee-JSON-data.json
Main.dart code at the moment:
var jsonString = 'Sample-JSON-data.json';
var response = jsonDecode(jsonString);
print(response);
I have verified my json data on multiple test sites as well as tried various methods in the Flutter Documentation. Json data:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.0763783444317,
-33.98045132346684
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.07774912725728,
-33.97470462237792
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.07774912725728,
-33.97470462237792
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.07774912725728,
-33.97470462237792
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.0763783444317,
-33.98045132346684
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.07774912725728,
-33.97470462237792
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.07774912725728,
-33.97470462237792
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.07774912725728,
-33.97470462237792
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
151.0763783444317,
-33.98045132346684
]
}
}
]
}
jsonDecode expects an input to be valid JSON serialized into String fe.
{ "message": "Hello World!" }. So this would work: jsonDecode('{"message": "Hello World!"}').
What you are passing to it is a file name, it won't automatically read the file for you. You can check how to do that here:
Flutter - Read text file from assets
Actually you are not loading the data from the json file.
Try:
var jsonString = await rootBundle.loadString('Sample-JSON-data.json')

Google Spreadsheet RE2 Regex and Geojson

I have a Geojson in a google sheet cell. I'd like to extract coordinates from that. I tried using Regexextract function but I'm really having trouble in making the regex work.
This is a sample structure:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
62.22656249999999,
61.438767493682825
],
[
54.140625,
44.33956524809713
],
[
79.453125,
48.45835188280866
],
[
62.22656249999999,
61.438767493682825
]
]
]
}
}
]
}
what I want to obtain is
[[[62.22656249999999,61.438767493682825],[54.140625,44.33956524809713],[79.453125,48.45835188280866],[62.22656249999999,61.438767493682825]]]
Can you help me with that?
Thanks
=REGEXREPLACE(A5,"[^\[\]\.\d+,]",)
Anything except []., and digits gives a close approximation.
EDIT:
=REGEXEXTRACT(A5,"(?s)(\[\s+\[\s+\[.*\]\s+\]\s+\])")

GeoJSON object naming convention

A GeoJSON object might look something like this:
{
"type": "Point",
"coordinates": [
28.169778,
-25.886587
]
}
We may embed this into some other resource object, say a 'point of interest':
{
"id": "1266f0WqVkGB2BnnVhOvEw",
"name": "Eco Fushion, Witch-Hazel Ave",
"type": "TRANSIT",
"code": "ert222",
"point": {
"type": "Point",
"coordinates": [
28.169778,
-25.886587
]
}
}
Is there any convention as to what this GeoJSON object should be named as when embedded as a field?
In the above example, I have called it point.

Can't fetching records from nested JSON objects in Sencha Touch Application

I'm stuck with issue for getting web-service response from JSON in Sencha Touch.
I'm getting response from server.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "business_poi_en.1",
"geometry": {
"type": "Point",
"coordinates": [
28.21962354993591,
36.452844361147314
]
},
"geometry_name": "geom",
"properties": {
"status": "M",
"score": 100,
"side": "R",
"ref_id": 0,
"id": null,
"business_p": "AQUARIOUM",
}
},
{
"type": "Feature",
"id": "business_poi_en.2",
"geometry": {
"type": "Point",
"coordinates": [
28.225417523605692,
36.436470953176716
]
},
"geometry_name": "geom",
"properties": {
"status": "M",
"score": 68.44,
"match_type": "A",
"side": "L",
"ref_id": 0,
"id": null,
"business_p": "ZIGOS",
}
},
.... So On ....
I want to fetch data for coordinates from geometry tag, so I can display it on map via these coordinates.I also want to fetch data for business_p from properties tag as displaying title on map.
But, I can't get both of values for coordinates & business_p at same time from same response.
Any idea for getting values at same time ?
Any suggestion will be appreciated.
Please help with this issue.
Thanks in advance.
Your Store's proxy's reader should have correct rootProperty which is common parent of both coordinates and business_p. For that your response should be wrapped into a top level tag like this
{
"featureResponse": [
{
"type": "FeatureCollection",
"features": []
},
{
"type": "Feature",
"features": []
},
]
}
Then you can define reader like this:
reader: {
type: 'json',
rootProperty: 'featureResponse'
}
once you get record from this store, you can go to data or raw children object to fetch required data.