Click here to Skip to main content
15,887,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
JavaScript
decimal MyLat = ViewBag.MyLat;
decimal MyLong = ViewBag.MyLong;
<script src="https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=@MyLat,@MyLat&radius=500&types=food&name=cruise&key=MyKey"></script>

Showing me the following error:
"Uncaught SyntaxError: Unexpected token"

I try to keep data from Google Maps According to dynamically changing search (name, category, city, rating, etc.)
Something that can help me?
Thank you!
Posted

 
Share this answer
 
You can done this way. Please check

C#
@{

    decimal MyLat = 12347;
   decimal MyLong = 3494858;
   var script = string.Format("<script src='https://maps.googleapis.com/maps/api/place/nearbysearch/json?location={0},{1}&radius=500&types=food&name=cruise&key=MyKey'> </script?", MyLat, MyLong);
}

@Html.Raw(script);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900