Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

Scale indication in may map

This is a discussion on Scale indication in may map within the Bing Maps and MapPoint Web Service forums, part of the Map Forums category; Hi! Iīm programing in .Net 2.0 (C#) and MapPoint Web Service. I canīt found the property to show the Scale ...

  1. #1
    Txejo is offline Junior Member White Belt
    Join Date
    Aug 2007
    Posts
    2

    Scale indication in may map

    Hi!

    Iīm programing in .Net 2.0 (C#) and MapPoint Web Service.
    I canīt found the property to show the Scale in my map.

    Iīll try to explain better...
    I need to show the scale of the map I show like Virtual Earth and Google Maps do. That way the user can know the real size of what is seeing.

    Thanks
    Jon

  2. #2
    Txejo is offline Junior Member White Belt
    Join Date
    Aug 2007
    Posts
    2

    Re: Scale indication in my map

    Hi,

    Here is my auto-answer, specting will be useful to someone.

    MWS hasnīt got an Scale bar !!!!

    Ok, no matter, everything has a solution except what hasnīt.

    The MapImage returned by the "renderService.GetMap(mapSpec)" has 3 views of the returned map, viewByScale has the Scale value. Depending on the unit you use (Miles or Kilometers, the second in my case) the Scale value (50000 for example) means that 1Cm. of the returned map equals 50000 cm. of what is representing. Or what is the same: "1:50000".

    Assuming 96 dpi resolution (what is the most normal) 1cm = 37,795275591px (Itīs easy to find this value and the mile=px just search)
    Now you have to choose what you wanna do with this values, if you going to have a scale bar with constant width or you want a variable width ajusting to some values.

    What I do is this:
    maxbar = 200px = Maximun scale bar width.
    cmToPx = 37,795275591. Explained above.
    scale= 30738cm = the scale value returned getting the map with my app starts

    barToKm = (((maxbar /cmToPx )*scale)/100000) = how many km represents my bar with the maximun width.
    km=Truncate(batToKm) = I donīt want to show decimal values
    KmtoPx = (((km * 100000) / scale) * cmToPx) = How many pixels represents the truncated km value.

    Now I draw a bar with KmToPx width; and a label with km.toString().

    Thatīs All Folks

    Sorry for my bad english, and so long post.


    Txejo.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Map Scale
    By colin_turner99 in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 07-26-2006, 10:59 AM
  2. map scale
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-01-2005, 05:38 PM
  3. Minimum Map Scale?
    By bryker in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-09-2004, 05:21 PM
  4. overview map scale
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-19-2004, 11:42 AM
  5. Map Scale
    By ElenaF in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-15-2003, 04:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66