How to pass Json or JObject result into javascript function
CODES :
I use Postgres Database
Create table :
CREATE TABLE "TLandPoint"
(
gid integer NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
geom geometry,
"LandId" bigint NOT NULL,
"SumSpace" bigint NOT NULL,
"CityLevelId" bigint NOT NULL,
CONSTRAINT "PK_TLandPoint" PRIMARY KEY (gid)
USING INDEX TABLESPACE "MyDB"
)
TABLESPACE "MyDB";
ALTER TABLE "TLandPoint"
OWNER to postgres;
insert sample data
INSERT INTO "TLandPoint"(
geom, "LandId", "SumSpace", "CityLevelId")
VALUES ( '0101000000F30D15E765D355410C3A0D001F1B5041', 5698, 13500, 123001002);
and create view for convert geom to json
CREATE OR REPLACE VIEW "TLandPointView"
AS
SELECT "TLandPoint".gid,
st_asgeojson("TLandPoint".geom) AS jsonpoint,
"TLandPoint"."LandId",
"TLandPoint"."SumSpace",
"TLandPoint"."CityLevelId"
FROM "TLandPoint";
ALTER TABLE "TLandPointView"
OWNER TO postgres;
Load data from view with Linq
var TLandPts =DbContext.TLandPointView.AsQueryable();
and use this code to create JObject
JObject rss =
new JObject(
new JProperty("type", "FeatureCollection"),
new JProperty("features",
new JArray(from p in TLandPts select
new JObject(
new JProperty("id", p.gid),
new JProperty("type", "Feature"),
new JProperty("geometry", new JObject(JObject.Parse(p.jsonpoint))),
new JProperty("properties",
new JObject(
new JProperty("LandId", p.LandId),
new JProperty("SumSpace", p.SumSpace),
new JProperty("CityLevelId", p.CityLevelId)
)
)
)
)
)
);
var y = rss.ToString();
and use this code to pass y to my function
in controler
public IActionResult Index(){
ViewBag.Land = y;
return view()
}
in index.cshtml
<script>
LoadData('@ViewBag.Land');
</script
and into javascript
function loadData(mydata){
var PointSource = new ol.source.Vector({
features: new ol.format.GeoJSON().readFeatures(mydata)
});
var PointLayer = new ol.layer.Vector({
source: PointSource
});
map.addLayer(PointLayer);
}
codes in javascript changed to like this image
but when i copy result y variable into javascript for example mydata do not have any problem
free single chat
aidan turner and eleanor dating
buy zithromax 100mg online – azithromycin 500mg pills side effects of azithromycin
dating sites for over 50
teen dating websites
female viagra pill cost – cheap viagra online india pharmacy sildenafil daily
stromectol 3 mg – stromectol 3 mg dosage stromectol 3 mg dosage
dating gay men atlanta ga
free gay dating colombia
interracial gay dating site
gay dating sites in my area
gay adult dating sites
hiv gay dating
hollywood casino online – real money online casino online casino real money paypal
ed pills – for him ed pills top erection pills
az gay dating
dating site for gay cd
free gay men dating site
buy prednisone from india – 1250 mg prednisone 20 mg prednisone
good dating site for gay women
gay dating website india
gay dating free
buy viagra 100 mg online – how to buy viagra tablets in india sildenafil uk
10 gay dating disasters
gay bear dating sites
gay surfer dating
gay speed dating problem
gay phone dating site
fake gay dating profile
gay thug dating ad
dating sites for gay bears
[url=”http://gaychatus.com?”]gay dating sites mumbai[/url]
zoloft sleep zoloft blob
amlodipine / benazeprilat amlodipine 5mg tab
how to wean off lexapro 5 mg lexapro and weight gain in stomach
erectile dysfunction drugs over the counter – ed drugs compared ed pills cvs
omeprazole 40mg can you take zantac with prilosec
what are the negative side effects of lisinopril? lisinopril 10 mg image
quetiapine fumarate 25mg seroquel and quetiapine
what does atorvastatin do natural alternatives to lipitor
cymbalta with wellbutrin drug interaction oxycodone and duloxetine
best time to take zoloft zoloft and buspar
amlodipine ed blood pressure medications norvasc
lexapro bipolar escitalopram price without insurance
ranitidine vs prilosec omeprazole and ranitidine together
quetiapine fumarate 200 mg tab seroquel side effects
lisinopril for dogs hydrochlorothiazide blood pressure
duloxetine 20 mg cbd oil and cymbalta
side effect of norvasc amlodipine contraindications
lisinopril hctz 10-12.5 spironolactone hydrochlorothiazide
what is amlodipine besylate 10mg used for has norvasc been recalled
escitalopram oxalate side effects of escitalopram
п»їprilosec prilosec or zantac
quetiapine and dementia quetiapine dose
lisinopril and aspirin hydrochlorothiazide coronavirus
alcohol and cymbalta duloxetine 60 mg side effects
doxycycline 200mg price in india – doxycycline for sale online uk doxycycline india
silver seniors dating gay
sgh id gay dating
gay dating on facebook
gay dating korean sites
professional gay men dating
damian lotz poland gay dating
gay dating sites chicago
gay lesbian dating service
[url=”gaydatingcanada.com?”]gay dating like craigslist[/url]
gay dating in grass valley ca
are gay dating sites cheating
dating foreign gay men
a real true gay dating
gay sugar dating
gay dating usa
gay texas zoophilia dating
middle eastern gay men dating
indian dating gay
actual gay dating sites
christianmingle gay dating
hilarious gay online dating
old gay dating
gay dating phobe chat
gay dating games
sildenafil online canada – sildenafil coupon non prescription sildenafil
dissertation writing help
dissertation help service
do my essay
write my college essay
tadalafil medicine in india – Price cialis cialis pill cost
prednisone 477 – buy prednisone best pharmacy prednisone
online casino gambling – online casino games ocean casino online
plaquenil usa – buy plaquenil 400mg pills buy hydroxychloroquine online cheap