location.lat is not a function - google-maps

I'm trying to write a unit test for getAddress() a function that gets the address from a google.maps.places.autocomplete. To trigger the function I need to set a new place programmatically because the place_changed event handler calls getAddress(). When setting a place using the GUI location.lat is a function and when doing programmatically it is a property.
So to set a new place I do this:
let place = { "address_components": [{ "long_name": "Auckland", "short_name": "Auckland", "types": ["locality", "political"] }, { "long_name": "Auckland", "short_name": "Auckland", "types": ["administrative_area_level_2", "political"] }, { "long_name": "Auckland", "short_name": "Auckland", "types": ["administrative_area_level_1", "political"] }, { "long_name": "New Zealand", "short_name": "NZ", "types": ["country", "political"] }], "adr_address": "<span class=\"locality\">Auckland</span>, <span class=\"country-name\">New Zealand</span>", "formatted_address": "Auckland, New Zealand", "geometry": { "location": { "lat": -36.8484597, "lng": 174.76333150000005 }, "viewport": { "south": -37.0654751, "west": 174.44380160000003, "north": -36.660571, "east": 175.2871371 } }, "icon": "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png", "id": "088418ddc17fef2513462d92dbee1355929b35ed", "name": "Auckland", "photos": [{ "height": 1836, "html_attributions": ["Johannes De Smedt"], "width": 3264 }, { "height": 2988, "html_attributions": ["Michal Panek"], "width": 5312 }, { "height": 3096, "html_attributions": ["Sakchhyam Malla"], "width": 4128 }, { "height": 3672, "html_attributions": ["Maria Bitunjac"], "width": 4896 }, { "height": 1836, "html_attributions": ["Carol Prichard"], "width": 3264 }, { "height": 3120, "html_attributions": ["Kovács György"], "width": 4208 }, { "height": 1504, "html_attributions": ["Martin Mobers"], "width": 2006 }, { "height": 492, "html_attributions": ["Priyesh Bhavsar"], "width": 1000 }, { "height": 2988, "html_attributions": ["Alvie Granito"], "width": 5312 }, { "height": 3265, "html_attributions": ["Simon Chen"], "width": 4898 }], "place_id": "ChIJ--acWvtHDW0RF5miQ2HvAAU", "reference": "CmRbAAAAEJGwhQ0l3O1QapXvbJ_s-xNVyh7UxBjd89D9Q860dfhb5Xh3xeY95UT1tIdugiTRhhZHT2qk_wzUqfd3wPS-vdX1pBljxcPtMUqhTtslzMyVccViA9ckk50Xv_cFWNXFEhCPkvW84Okrk2SJUpUDLGz8GhSEN1dm_0tJj4nEHYo0-bkRdOykYQ", "scope": "GOOGLE", "types": ["locality", "political"], "url": "https://maps.google.com/?q=Auckland,+New+Zealand&ftid=0x6d0d47fb5a9ce6fb:0x500ef6143a29917", "utc_offset": 780, "vicinity": "Auckland" }
testHost.areaPicker.autocomplete.set("place", place);
regarding my place variable I get this compile time error:
'"adr_address"' does not exist in type 'PlaceResult'.
However when I do this, for some reason the resulting place object's geometry.lat and geometry.lng are no longer functions but now they are properties.
But when I use the autocomplete in real scenarios they are functions. As they should be. How do I get them to be functions in my unit test? Full code below.
Unit test:
it('EmitAreaChanged_AreaEntered_AreaPlaceValueMakesItToHost', () => {
let place = { "address_components": [{ "long_name": "Auckland", "short_name": "Auckland", "types": ["locality", "political"] }, { "long_name": "Auckland", "short_name": "Auckland", "types": ["administrative_area_level_2", "political"] }, { "long_name": "Auckland", "short_name": "Auckland", "types": ["administrative_area_level_1", "political"] }, { "long_name": "New Zealand", "short_name": "NZ", "types": ["country", "political"] }], "adr_address": "<span class=\"locality\">Auckland</span>, <span class=\"country-name\">New Zealand</span>", "formatted_address": "Auckland, New Zealand", "geometry": { "location": { "lat": -36.8484597, "lng": 174.76333150000005 }, "viewport": { "south": -37.0654751, "west": 174.44380160000003, "north": -36.660571, "east": 175.2871371 } }, "icon": "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png", "id": "088418ddc17fef2513462d92dbee1355929b35ed", "name": "Auckland", "photos": [{ "height": 1836, "html_attributions": ["Johannes De Smedt"], "width": 3264 }, { "height": 2988, "html_attributions": ["Michal Panek"], "width": 5312 }, { "height": 3096, "html_attributions": ["Sakchhyam Malla"], "width": 4128 }, { "height": 3672, "html_attributions": ["Maria Bitunjac"], "width": 4896 }, { "height": 1836, "html_attributions": ["Carol Prichard"], "width": 3264 }, { "height": 3120, "html_attributions": ["Kovács György"], "width": 4208 }, { "height": 1504, "html_attributions": ["Martin Mobers"], "width": 2006 }, { "height": 492, "html_attributions": ["Priyesh Bhavsar"], "width": 1000 }, { "height": 2988, "html_attributions": ["Alvie Granito"], "width": 5312 }, { "height": 3265, "html_attributions": ["Simon Chen"], "width": 4898 }], "place_id": "ChIJ--acWvtHDW0RF5miQ2HvAAU", "reference": "CmRbAAAAEJGwhQ0l3O1QapXvbJ_s-xNVyh7UxBjd89D9Q860dfhb5Xh3xeY95UT1tIdugiTRhhZHT2qk_wzUqfd3wPS-vdX1pBljxcPtMUqhTtslzMyVccViA9ckk50Xv_cFWNXFEhCPkvW84Okrk2SJUpUDLGz8GhSEN1dm_0tJj4nEHYo0-bkRdOykYQ", "scope": "GOOGLE", "types": ["locality", "political"], "url": "https://maps.google.com/?q=Auckland,+New+Zealand&ftid=0x6d0d47fb5a9ce6fb:0x500ef6143a29917", "utc_offset": 780, "vicinity": "Auckland" }
testHost.areaPicker.autocomplete.set("place", place);
expect(testHost.placeValue).toBe(true);
});
relevant part of my component under test that uses a google autocomplete:
ngAfterViewInit() {
this.autocomplete = new google.maps.places.Autocomplete(
<HTMLInputElement>this.areaInput.nativeElement, this._options);
this.autocomplete.addListener('place_changed', () => {
this.getAddress(this.autocomplete)
});
this.areaInput.nativeElement.setCustomValidity("");
}
public getAddress(autocomplete: google.maps.places.Autocomplete): void {
if (this._canGetAddress) {
var place: google.maps.places.PlaceResult = autocomplete.getPlace();
this.address = place['formatted_address'];
var location = place['geometry']['location'];
var lat = location.lat();
var lng = location.lng();
this.onAreaChanged.emit({areaEntered: true, place: place});
this.areaInput.nativeElement.setCustomValidity("");
}
}
Here is my code I want to test:
public getAddress(autocomplete: google.maps.places.Autocomplete): void {
if (this._canGetAddress) {
var place: google.maps.places.PlaceResult = autocomplete.getPlace();
this.address = place['formatted_address'];
var location = place['geometry']['location'];
var lat = location.lat();
var lng = location.lng();
this.onAreaChanged.emit({areaEntered: true, place: place});
this.areaInput.nativeElement.setCustomValidity("");
}
}

The location needs to be a google.maps.LatLng object.

Related

Importing JSON file to MongoDB 'Operation passed in cannot be an Array' error

I'm trying to import a json dataset into my MongoDB collection and am getting this error, 'Operation passed in cannot be an Array'. I'm not too sure which array is casuing the issue of what I can chnage to fix this. This is the strucutre of my json file:
[
{
"business_status": "OPERATIONAL",
"formatted_address": "Divis Rd, Hannahstown, Belfast BT17 0NG",
"geometry":
[{
"location": {
"lat": 54.6054311,
"lng": -5.999924500000001
},
"viewport": {
"south": 54.60408127010727,
"west": -6.001274329892722,
"north": 54.60678092989272,
"east": -5.998574670107279
}
}],
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/park-71.png",
"icon_background_color": "#4DB546",
"icon_mask_base_uri": "https://maps.gstatic.com/mapfiles/place_api/icons/v2/tree_pinlet",
"name": "Black Mountain",
"photos": [
{
"height": 3024,
"html_attributions": [
"A Google User"
],
"width": 4032
}
],
"place_id": "ChIJB5sGQEYHYUgRDxrlOYU58As",
"plus_code": [{
"compound_code": "J242+52 Belfast",
"global_code": "9C6PJ242+52"
}],
"rating": 4.9,
"reference": "ChIJB5sGQEYHYUgRDxrlOYU58As",
"types": [
"park",
"point_of_interest",
"establishment"
],
"user_ratings_total": 49,
"html_attributions": []
}
]

autocomplete google address api

I am using google autocomplete address api, it returns all the required data but not postal code. Any idea how to get postal code in api response. Below is the my url and api response returned by this api.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=19becket st &types=address&key=my_api_key
data return is in following format
{
"description": "19 Becket St, Boston, MA, USA",
"matched_substrings": [
{
"length": 2,
"offset": 0
},
{
"length": 9,
"offset": 3
}
],
"place_id": "ChIJN9v2H4l744kRRg9DI6ctGhY",
"reference": "ChIJN9v2H4l744kRRg9DI6ctGhY",
"structured_formatting": {
"main_text": "19 Becket St",
"main_text_matched_substrings": [
{
"length": 2,
"offset": 0
},
{
"length": 9,
"offset": 3
}
],
"secondary_text": "Boston, MA, USA"
},
"terms": [
{
"offset": 0,
"value": "19"
},
{
"offset": 3,
"value": "Becket St"
},
{
"offset": 14,
"value": "Boston"
},
{
"offset": 22,
"value": "MA"
},
{
"offset": 26,
"value": "USA"
}
],
"types": [
"premise",
"geocode"
]
},
Use the place_id to do a followup request for place details.
Use the same session token for both the autocomplete requests and details requests
Use the fields parameter in the details requests
https://maps.googleapis.com/maps/api/place/details/json
?fields=address_components
&place_id=ChIJN9v2H4l744kRRg9DI6ctGhY
&key=YOUR_API_KEY
The zip code will be in the address_components field of the response with type postal_code similar to the following:
{
address_components":
[
{ "long_name": "48", "short_name": "48", "types": ["street_number"] },
{
"long_name": "Pirrama Road",
"short_name": "Pirrama Rd",
"types": ["route"],
},
{
"long_name": "Pyrmont",
"short_name": "Pyrmont",
"types": ["locality", "political"],
},
{
"long_name": "Council of the City of Sydney",
"short_name": "Sydney",
"types": ["administrative_area_level_2", "political"],
},
{
"long_name": "New South Wales",
"short_name": "NSW",
"types": ["administrative_area_level_1", "political"],
},
{
"long_name": "Australia",
"short_name": "AU",
"types": ["country", "political"],
},
{
"long_name": "2009",
"short_name": "2009",
"types": ["postal_code"],
},
],
}

Uncaught Error: You're trying to decode an invalid JSON String

I have facing problems with EXT js code to store data using Java.
Below is my code. Can one please help me.
Below is my NewCustomersVerify.js code:
var myHit = Ext.create('Ext.data.Store',{
fields:['Id','Name'],
data:[
{Id:'0',Name:'No'},
{Id:'1',Name:'Yes'}
]
});
var myRisk = Ext.create('Ext.data.Store',{
fields:['Id','Name'],
data:[
{Id:'0',Name:'Low'},
{Id:'1',Name:'High'}
]
});
Ext.define('Test.test.web.test.view.test.NewCustomersVerify', {
"xtype": "newCustomersVerify",
"items": [{
"xtype": "panel",
"items": [{
"xtype": "panel",
"items": [{
"xtype": "displayfield",
"fieldLabel": "Name :",
"margin": 5,
"value": "TEXT",
"name": "customerName",
"title": "Customer Name",
"itemId": "lnajnbi", "bind": "{customerName}"
},{
"xtype": "displayfield",
"fieldLabel": "Nationality :",
"margin": 5,
"value": "TEXT",
"name": "nationality",
"title": "Nationality",
"itemId": "lnbjnbi", "bind": "{nationality}"
},{
"xtype": "displayfield",
"fieldLabel": "UniqueId No :",
"margin": 5,
"value": "TEXT",
"name": "uniqueIdNo",
"title": "UniqueId No",
"itemId": "lncjnbi", "bind": "{uniqueIdNo}"
},{
"xtype": "hiddenfield",
"fieldLabel": "HiddenText",
"bindable": "contactId",
"margin": 5,
"name": "contactId",
"title": "HiddenText",
"itemId": "oidgafi",
"bind": "{contactId}"
},{
"xtype": "hiddenfield",
"fieldLabel": "HiddenText",
"bindable": "screeningId",
"margin": 5,
"name": "screeningId",
"title": "HiddenText",
"itemId": "didgafi",
"bind": "{screeningId}"
}],
"layout": "vbox",
"autoScroll": true,
"margin": 5,
"columnWidth": 0.5,
"itemId": "cieadni",
"dockedItems": []
}, {
"xtype": "panel",
"items": [
{
"xtype": "combo",
"fieldLabel": "Was there a verify hit?",
"name": "screeningHit",
"margin": 5,
"bindable": "screeningHit",
"title": "Was there a verify hit?",
"columnWidth": 0.5,
"width": "100",
"labelAlign": "left",
"itemId": "kbfmjgi",
displayField:'Name',
valueField:'Id',
queryMode:'local',
store: myHit,
}, {
"xtype": "combo",
"fieldLabel": "Country Risk (Nationality)",
"name": "countryRisk",
"margin": 5,
"bindable": "countryRisk",
"title": "Country Risk (Nationality)",
"columnWidth": 0.5,
"width": "100",
"labelAlign": "left",
"itemId": "kbgajgi",
displayField:'Name',
valueField:'Id',
queryMode:'local',
store: myRisk
}, {
"xtype": "combo",
"fieldLabel": "Occupation Risk",
"name": "occupationRisk",
"margin": 5,
"bindable": "occupationRisk",
"title": "Occupation Risk",
"columnWidth": 0.5,
"width": "100",
"labelAlign": "left",
"itemId": "kbaajgi",
displayField:'Name',
valueField:'Id',
queryMode:'local',
store: myRisk
}, {
"xtype" : "filefield",
"fieldLabel": "Upload evidence of verify (Screenshot from the verify portal)",
"msgTarget" : "side",
"allowBlank" : "false",
"buttonOnly" : "true",
"margin" : 5,
"name" : "uploadFile",
buttonConfig : {
"text" : "Upload",
"icon" : "images/cloud/upload.png",
},
listeners : {
change :"uploadFile"
}
}],
"layout": "vbox",
"autoScroll": true,
"margin": 5,
"columnWidth": 0.5,
"itemId": "nehbeki",
"dockedItems": []
}],
"layout": "column",
"autoScroll": true,
"border": true,
"margin": 5,
"itemId": "gjihcpi",
"dockedItems": [{
"xtype": "toolbar",
"dock": "bottom",
"ui": "footer",
"isToolBar": true,
"isDockedItem": true,
"items": [{
"xtype": "tbfill",
"itemId": "hajhegi"
},
/* {
"xtype": "button",
"name": "cancel",
"text": "Cancel",
"margin": 5,
"isResetButton": true,
"itemId": "bbkmkmi",
"listeners": {
"click": "oncancelclick"
}
},*/
{
"xtype": "button",
"name": "Confirm",
"text": "Confirm",
"margin": 5,
"itemId": "celbgji",
"listeners": {
"click": "onConfirmclick"
}
}],
"columnWidth": 0.5,
"itemId": "lfmepni",
"dockedItems": []
}]
}],
"border": true,
"autoScroll": false,
// "title": "New Customer Verify",
"margin": 5,
"itemId": "dinfmki",
"dockedItems": [],
"extend": "Ext.form.Panel",
"listeners": {
"afterrender": "onafterrender",
"scope": "controller"
},
"requires": ["Test.test.web.test.controller.test.NewCustomersVerifyController", "Test.test.shared.test.viewmodel.test.NewCustomersVerifyViewModel", "Test.test.shared.test.model.test.NewCustomersVerifyModel"],
"viewModel": "NewCustomersVerifyViewModel",
"controller": "NewCustomersVerifyController"
});
Below is my button onConfirmclick function call on NewCustomersVerifyContoller.js
onConfirmclick: function(me, e, eOpts) {
var jsonData = {};
jsonData.contactId = this.view.down('#oidgafi').getValue();
jsonData.screeningId = this.view.down('#didgafi').getValue();
jsonData.screeningHit = this.view.down('#kbfmjgi').getValue();
jsonData.countryHit = this.view.down('#kbgajgi').getValue();
jsonData.occupationHit = this.view.down('#kbaajgi').getValue();
var scope = this.getView();
Ext.MessageBox.show({
msg : 'Saving data...',
progressText : 'Saving...',
width : 300,
wait : true,
waitConfig : {
interval : 200
}
});
Ext.Ajax.request({
url: 'secure/NewCustomersVerifyServiceWS/respond',
method: 'POST',
sender: scope,
jsonData: jsonData,
me: me,
success: function(response, scope) {
Ext.MessageBox.hide();
responseData = Ext.JSON.decode(response.responseText);
Ext.Msg.alert('Server Response', responseData.response.message);
win = scope.sender.up();
win.reportViewController.queryCriteria.controller.filterData(win.searchButtonRef);
win.close();
},
failure: function(response, scope) {
Ext.MessageBox.hide();
responseData = Ext.JSON.decode(response.responseText);
Ext.Msg.alert('Server Response', responseData.response.message);
}
}, scope);
}
Below is the error i was getting on the browser console.
[E] Ext.JSON.decode(): You're trying to decode an invalid JSON String:
Apache Tomcat/8.0.21 - Error
reportH1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}.line {height: 1px;
background-color: #525D76; border: none;}
HTTP Status 400 - type Status reportmessage
description The request sent by the client was
syntactically incorrect.Apache
Tomcat/8.0.21
Error is on Ajax success or failure function. You are trying to decode invalid json which is passed from your controller (or middle layer server). You need to console the response before decode any string.
Just add console log before Ext.decode(). and post response here. That will solve your problem.
thank you for your support.
I have declared the variable occupationRisk as **occupationHit **.
That's the problem... Now its solved.

Export Google map directions to lat/long

I have multiple sets of lat/long coordinates that I am using in the Google directions API with way points to get directions following roads and paths. Each set of coordinates have about 100 points which I am converting to a usable number for the start, end and waypoints.
I would like to get the lat/long values from the directions which are returned from Google. Basically get each coordinate from each road segment.
Is this possible?
Yes, by using the direction API, you would get a respond like this:
{
"status": "OK",
"geocoded_waypoints" : [
{
"geocoder_status" : "OK",
"place_id" : "ChIJ7cv00DwsDogRAMDACa2m4K8",
"types" : [ "locality", "political" ]
},
{
"geocoder_status" : "OK",
"place_id" : "ChIJ69Pk6jdlyIcRDqM1KDY3Fpg",
"types" : [ "locality", "political" ]
},
{
"geocoder_status" : "OK",
"place_id" : "ChIJgdL4flSKrYcRnTpP0XQSojM",
"types" : [ "locality", "political" ]
},
{
"geocoder_status" : "OK",
"place_id" : "ChIJE9on3F3HwoAR9AhGJW_fL-I",
"types" : [ "locality", "political" ]
}
],
"routes": [ {
"summary": "I-40 W",
"legs": [ {
"steps": [ {
"travel_mode": "DRIVING",
"start_location": {
"lat": 41.8507300,
"lng": -87.6512600
},
"end_location": {
"lat": 41.8525800,
"lng": -87.6514100
},
"polyline": {
"points": "a~l~Fjk~uOwHJy#P"
},
"duration": {
"value": 19,
"text": "1 min"
},
"html_instructions": "Head \u003cb\u003enorth\u003c/b\u003e on \u003cb\u003eS Morgan St\u003c/b\u003e toward \u003cb\u003eW Cermak Rd\u003c/b\u003e",
"distance": {
"value": 207,
"text": "0.1 mi"
}
},
...
... additional steps of this leg
...
... additional legs of this route
"duration": {
"value": 74384,
"text": "20 hours 40 mins"
},
"distance": {
"value": 2137146,
"text": "1,328 mi"
},
"start_location": {
"lat": 35.4675602,
"lng": -97.5164276
},
"end_location": {
"lat": 34.0522342,
"lng": -118.2436849
},
"start_address": "Oklahoma City, OK, USA",
"end_address": "Los Angeles, CA, USA"
} ],
"copyrights": "Map data ©2010 Google, Sanborn",
"overview_polyline": {
"points": "a~l~Fjk~uOnzh#vlbBtc~#tsE`vnApw{A`dw#~w\\|tNtqf#l{Yd_Fblh#rxo#b}#xxSfytAblk#xxaBeJxlcBb~t#zbh#jc|Bx}C`rv#rw|#rlhA~dVzeo#vrSnc}Axf]fjz#xfFbw~#dz{A~d{A|zOxbrBbdUvpo#`cFp~xBc`Hk#nurDznmFfwMbwz#bbl#lq~#loPpxq#bw_#v|{CbtY~jGqeMb{iF|n\\~mbDzeVh_Wr|Efc\\x`Ij{kE}mAb~uF{cNd}xBjp]fulBiwJpgg#|kHntyArpb#bijCk_Kv~eGyqTj_|#`uV`k|DcsNdwxAott#r}q#_gc#nu`CnvHx`k#dse#j|p#zpiAp|gEicy#`omFvaErfo#igQxnlApqGze~AsyRzrjAb__#ftyB}pIlo_BflmA~yQftNboWzoAlzp#mz`#|}_#fda#jakEitAn{fB_a]lexClshBtmqAdmY_hLxiZd~XtaBndgC"
},
"warnings": [ ],
"waypoint_order": [ 0, 1 ],
"bounds": {
"southwest": {
"lat": 34.0523600,
"lng": -118.2435600
},
"northeast": {
"lat": 41.8781100,
"lng": -87.6297900
}
}
} ]
}
Where you can get the lat/lng of each turning points under steps. You can even decode the polyline to get the set of points which describe the road.

Show/hide a KineticJS layer loaded from JSON within Angular

I am trying to hide a layer in KineticJS that is built from a JSON string. The layer won't hide, however. If I try to hide a shape having an ID in the JSON, it does work. Not sure if I have incorrectly created my layer ID in the JSON, or if KineticJS has issues with layer showing/hiding. There is no console error. The layer just won't hide. KineticJS is version v5.1.1. Help?
Here's the relevant JSON....
{
"attrs": {
"width": 524,
"height": 500
},
"className": "Stage",
"children": [
{
"attrs": {},
"className": "Layer",
"id": "layer1",
"children": [
{
"attrs": {
"draggable": true
},
"className": "Group",
"children": [
{
"attrs": {
"id": "firstShape",
"x": 25,
"y": 25,
"radius": 190,
"fill": "green"
},
"className": "Circle"
},
{
"attrs": {
"width": "auto",
"height": "auto",
"x": 64,
"y": 120,
"text": "Some label",
"fontSize": 10,
"fontFamily": "Arial",
"fill": "white"
},
"className": "Text"
}
]
}
]
}
]
}
Here's the event handler which does the layer hide... I find that this is getting called correctly, and the layer just isn't hiding.
scope.$on('hideLayer', function(){
scope.kineticStageObj.get('#layer1').hide();
scope.kineticStageObj.draw();
});
Looks like your json is wrong. id of layer should be inside attrs object.
"attrs": {
"id: : "layer1"
},
Try this:
{
"attrs": {
"width": 524,
"height": 500
},
"className": "Stage",
"children": [
{
"attrs": {
"id": "layer1"
},
"className": "Layer",
"children": [
{
"attrs": {
"draggable": true
},
"className": "Group",
"children": [
{
"attrs": {
"id": "firstShape",
"x": 25,
"y": 25,
"radius": 190,
"fill": "green"
},
"className": "Circle"
},
{
"attrs": {
"width": "auto",
"height": "auto",
"x": 64,
"y": 120,
"text": "Some label",
"fontSize": 10,
"fontFamily": "Arial",
"fill": "white"
},
"className": "Text"
}
]
}
]
}
]
}