×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    43

    Question how add text to circles and Polygons ??

    hello i have this code:

    figure=new nokia.maps.map.Circle(
    coordinate,
    coordinate.distance(coordinate2),
    {
    pen: {
    strokeColor: "#C22A",
    lineWidth: 2
    },
    brush: {
    color: "#0FF6"
    }
    }
    );

    map.objects.add(figure);
    ------------------

    figure=new nokia.maps.map.Polygon(myGeoStrip,
    {
    precision: 36,
    simplify: 16,
    fillColor: "#0FF6",
    color: "#C22A",
    width: 2
    });
    map.objects.add(figure);
    --------------

    how can i add a text in the center of each figure?

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: how add text to circles and Polygons ??

    I never seen any polygon nor circle items with any maps offerigns I have checked which would also include text in them, thus you would likely need to add additional object on the top of it. and center it to middle.

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    43

    Re: how add text to circles and Polygons ??

    ok thanks for the reply!

  4. #4
    Nokia Developer Moderator
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    288

    Re: how add text to circles and Polygons ??

    The key to doing this is to use SVG graphics. The SVG custom marker playground example includes a method of placing text in a circle see: http://api.maps.nokia.com/en/playgro...svgmarker.html
    Placing text over a polyline is a bit more tricky, however it would be possible to draw the polyline and add another SVG marker displaying text (without a background color) to a specified central geocoordinate. in other words use two markers, one for
    the line, one for the text.

    The method for doing this is discussed here: http://www.developer.nokia.com/Commu...Text-on-Marker - the example uses a StandardMarker, but any MapObject with a zIndex could be used.

  5. #5
    Registered User
    Join Date
    May 2012
    Posts
    43

    Re: how add text to circles and Polygons ??

    thanks for the answer!

Similar Threads

  1. Drawing polygons with box2d
    By tuxier in forum [Archived] Qt Quick
    Replies: 0
    Last Post: 2011-08-05, 10:57
  2. DrawEllipse and smooth circles
    By hclemson in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-09-11, 17:47
  3. Plot method not drawing smooth circles
    By jinuthomas in forum Symbian User Interface
    Replies: 0
    Last Post: 2009-04-01, 13:07
  4. SVG and circles + phone restart
    By ljubex in forum Symbian
    Replies: 4
    Last Post: 2007-01-10, 19:12
  5. Problems with draw a meny circles.
    By ramis55 in forum Symbian
    Replies: 0
    Last Post: 2004-10-28, 12:13

Posting Permissions

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