Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8526771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:22:08+00:00 2026-06-11T08:22:08+00:00

i did this code File Real.cs public ActionResult Index() { IList<Eventdata> liste = DATA2.Eventdata.GetEventdata();

  • 0

i did this code
File Real.cs

public ActionResult Index() {
    IList<Eventdata> liste = DATA2.Eventdata.GetEventdata();
    int a = liste.Count;

    float lat = liste[a-2].Latitude;
    float longi = liste[a-2].Longitude;
    IList<float> model = new List<float>();
    model.Add(lat);
    model.Add(longi);
    return View(model);
}

i mapped the table EventData : it contains two attributs floats ( Latitude,Longitude) and i want to know its last values.

File Index.CShtml

@model IList<float> @{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Lay3.cshtml";  
}

    <body  onload="initialize(@Model[0],@Model[1])">
    <div id="map_canvas" style="width: 800px; height: 500px;">
    </div>
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript">
    </script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
    </script>
    <script type="text/javascript">

    function initialize(a, b) {
        alert(a);
        alert(b);
        var myLatLng = new google.maps.LatLng(a,b);

        var myOptions = {
            zoom: 30,
            center: myLatLng,
            mapTypeId: google.maps.MapTypeId.TERRAIN
        };

        var map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
        var flightPlanCoordinates = [
        new google.maps.LatLng(a,b)
        ];

        var flightmarker = new google.maps.Marker({
   position: new google.maps.LatLng(a,b),
  map: map, title: " denden"
        });
    }    

    </script>
    </body>

and i have the last point like that :
Latitude=34.75064 and the longitude=10.761744 . but the messages are : 34 and 75064.
Why? And how can i correct it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:22:09+00:00Added an answer on June 11, 2026 at 8:22 am

    Try using( or set culture with ‘.’ decimal digit separator)

    <body  onload="initialize('@Model[0]','@Model[1]')"> // This will pass your value as
    //two parameters(instead of four) but it can be used only as a string because
    //javascript can parse decimal values only with '.' separator
    

    Instead of

    <body  onload="initialize(@Model[0],@Model[1])">
    

    If you call initialize method with 34,75064 and 10,761744 you are actually passing four parameters. Because of that a = 34 and b = 75064.

    You need to check culture when passing parameters from server to client because when culture have ‘,’ insead of ‘.’ for decimal digit separator your code wont work as expected.

    In your case with map you need decimal value, so you can’t use

    <body  onload="initialize('@Model[0]','@Model[1]')">
    

    You need to covert your decimal to appropriate culture like this

    var culture = CultureInfo.GetCultureInfo("en-US");
    ...
    <body  onload="initialize(@Model[0].ToString(culture), @Model[1].ToString(culture))">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

according to this code i dont understand about NSClassFromString how did i know viewControllerName
Did I not get enough sleep or what? This following code var frame=document.getElementById(viewer); frame.width=100;
This is the code i have. The NSDictionary did used to be something, but
I just recently found myself writing this line of code, which i did not
I want v0.1.27 of nodejs code base. This is what I did. git clone
This code overwrites the file.... I want my previous data to remain the same..
I use this piece of code in my bash script to read a file
This is regarding unpacking the encoded rgb values in a pcl file. I did
I have this code (snippet) from a .h file: #import <UIKit/UIKit.h> #import ILView.h /**
I have this JSON response string: {d:{\ID_usuario\:\000130\,\Nombre\:null,\Vipxlo\:0,\Provmun\:null,\Descuentos\:null,\Listaviplocal\:null}}` With this code: - (void)connectionDidFinishLoading:(NSURLConnection *)connection {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.