AnsweredAssumed Answered

Code Behind for showing a graphic(Icon) on a particular  the location .

Question asked by meenu.monu on Aug 18, 2015
Latest reply on Aug 19, 2015 by meenu.monu

Dear Friends,

 

I just started to move technology of my web application from silverlight to Javascript API.

 

I wanted to do only map display in Java. rest all code need to write with vb.net. Any samples  available for that?

Pls see my design code below.Here map display working perfect

When I click show report button, The map should zoom to a particular location for Eg long: 52.899, Lat :23.444

How to write code behind in vb.net for adding a graphic icon on a particular location? Can anyone hwlp me?

 

Default.aspx design page code below

 

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head id="Head1" runat="server">

    <title>Mapping</title>

 

 

    <style type="text/css">

        .auto-style2 {

            width: 260px;

            height: 100%;

        }

        .auto-style3 {

            width: 100%;

            height: 100%;

        }

    </style>

 

  

 

</head>  

<body  style="background-image: url('Images/menubackground.png');"  >

<form id="form2" runat="server">

    <div style="width: 100%; height: 100%">

                <table id="Tablecontrols0"   style="font-size: 15px; z-index: 101;

            background-color: #5B748B; width: 100%; height: 100%;">

            <tr style="font-family: Times New Roman">

                <td style="border-style: none; background-color: #496277; height: 2%;"

                    valign="top" class="auto-style2" >

             

                     </td>

              

                <td align="left"   style="border-style: none; background-color: #496277; height: 2%;"

                    valign="top" class="auto-style3" >

             

                     </td>

              

            </tr>

            <tr style="font-family: Times New Roman">

                <td style="border-style: none;"

                    valign="top" bgcolor="#496277"  >

             

                    <table id="Tablecontrols"   style="border-color: #F2F0EE; font-size: 15px; z-index: 101;

            background-color: #496277; width:auto; height: 274px; font-family: verdana; color: tomato; font-weight: bold; border-top-style: none;" align="left">

           

          

             

        

            <tr style="font-family: Times New Roman">

                <td

                    colspan="2" rowspan="1" style="border-width: 2px; font-weight: bold;  position: static;

                    height: 24px; text-align: center; border-top-color: #547289; border-bottom-color: #547289; border-top-style: solid; border-bottom-style: solid;" valign="top" align="left">

                    <br />

                    <asp:LinkButton ID="LnkLastPosition" runat="server" Font-Bold="True"

                        Font-Names="Verdana" Font-Size="11pt" Height="21px" Style="text-align: center; font-size: 15px;"

                        ToolTip="Click here for Viewing Reports" Width="153px" Font-Italic="False" Font-Underline="False" ForeColor="Black" BackColor="#F2F0EE" BorderStyle="Solid" BorderWidth="1px">Show Report</asp:LinkButton>

                    <br />

                    <br />

                </td>

               

            </tr>

            <tr style="font-family: Times New Roman">

                <td

                    colspan="2" style="font-weight: bold;  position: static;

                    height: 24px; text-align: center; border-top-color: #F2F0EE; border-bottom-color: #F2F0EE;" valign="top" align="center">

                     </td>

               

            </tr>

        </table>

     

                </td>

              

                <td style="border-style: none; background-color: transparent; background-image: url('Images/menubackground.png');"

                    valign="top" id="td11" >

             

                   <html>

  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <!--The viewport meta tag is used to improve the presentation and behavior of the samples

      on iOS devices-->

    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">

    <title>Create Map and add a dynamic layer</title>

    <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css"/>

    <style>

      html, body, #mapDiv{

        padding: 0;

        margin: 0;

        height: 100%;

      }

    </style>

    <script src="http://js.arcgis.com/3.14/"></script>

    <script>

        var map;

 

        require([

          "esri/map",

          "esri/layers/ArcGISDynamicMapServiceLayer",

          "esri/layers/ImageParameters"

        ], function (

          Map, ArcGISDynamicMapServiceLayer, ImageParameters) {

 

            map = new Map("mapDiv", {

                sliderOrientation: "horizontal"

            });

 

            var imageParameters = new ImageParameters();

            imageParameters.format = "jpeg"; //set the image type to PNG24, note default is PNG8.

 

            //Takes a URL to a non cached map service.

            var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer", {

                "opacity": 0.5,

                "imageParameters": imageParameters

            });

 

            map.addLayer(dynamicMapServiceLayer);

        });

    </script>

  </head>

  <body>

    <div id="mapDiv">    </div>

  </body>

</html>

          </td>

              

            </tr>

            </table>

     

     </div>

        </form>

</body>

</html>

Outcomes