Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In response to the second part of your question:</p> <blockquote> <p>i want a way to be able to pass all its records to my javascript and create a Marker for each Map i have in my table</p> </blockquote> <p>I have (as an example - written a year or so ago) the following code:</p> <p>In the code-behind I have something like this (c# I'm afraid):</p> <pre><code>[WebMethod] public LatitudeLogitudeMessage[] GetPoints(string postCodes) { string[] postCodeArray = postCodes.Split(",".ToCharArray()); LatitudeLogitudeMessage[] pointArray = new LatitudeLogitudeMessage[postCodeArray.Length]; int index = 0; foreach (string postCode in postCodeArray) { pointArray[index] = GetPoint(postCode); index++; } return pointArray; } </code></pre> <p>LatitudeLogitudeMessage is a custom class that looks like this:</p> <pre><code>public class LatitudeLogitudeMessage { public decimal? Latitude { get; set; } public decimal? Longitude { get; set; } public string Message { get; set; } public string Details { get; set; } public string Address { get; set; } public LatitudeLogitudeMessage(string addressToFind) { Address = addressToFind; Details = addressToFind.Replace(",", ",&lt;br /&gt;"); } } </code></pre> <p>The GetPoint method bascially fills in those details.</p> <p>In the code infront I then had:</p> <pre><code>PageMethods.GetPoints(address, showPoints); </code></pre> <p>Which calls the GetPoints method on the code behind, and passes the result to showPoints:</p> <pre><code>function showPoints(latLongs) { GLog.write("Showing points"); var points = []; var latLngBounds = new GLatLngBounds(); for (var i = 0; i &lt; latLongs.length; i++) { if ("" == latLongs[i].Message) { points[i] = new GLatLng(latLongs[i].Latitude, latLongs[i].Longitude); var marker = new GMarker(points[i], {title: latLongs[i].Details, clickable: false}); map.addOverlay(marker); latLngBounds.extend(points[i]); } else { GLog.write(latLongs[i].Message); } } if (points.length &gt; 1) { var bounds = new GBounds(points); var center = new GLatLng( (latLngBounds.getSouthWest().lat() + latLngBounds.getNorthEast().lat()) /2., (latLngBounds.getSouthWest().lng() + latLngBounds.getNorthEast().lng()) /2.); var newZoom = map.getBoundsZoomLevel(latLngBounds, map.getSize()); map.setCenter(center, newZoom); } else { map.setCenter(points[0], defaultZoomLevel); } } </code></pre> <p>So this takes the array of points, and iterates over them creating a marker as it goes, centering on the first item in the list (not clever, but it worked for me).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload