Jump to content

UniMap not displaying title


MOGSY

Recommended Posts

Hi

UniMap is not displaying title. I have used the UniMap Demo and added line Title := 'Test'; but it displays nothing. What I am not doing?

 

procedure TMainForm.UniButton7Click(Sender: TObject);
begin
  with UniMap1.Markers.Add do
  begin
    id:= Trunc(UniNumberEdit4.Value);
    Latitude:= UniFormattedNumberEdit5.Value;
    Longitude:= UniFormattedNumberEdit6.Value;
    Icon.iconUrl:= UniEdit1.Text;
    Title := 'Test';
    Draggable:= UniCheckBox2.Checked;
    AddToMap;
    PanToMarker(8);

  end;
end;

Thank you
 

Link to comment
Share on other sites

3 hours ago, MOGSY said:

UniMap is not displaying title. I have used the UniMap Demo and added line Title := 'Test'; but it displays nothing. What I am not doing?

Hi,

I will open a ticket in the support portal.

At the moment, you can change the 1312 line to (uniMap.pas):

'title', FTitle,

 

Link to comment
Share on other sites

Hi

Following code "https://jsfiddle.net/MuhammadArslan/faqok0c9/19/" gives extension to leaflet marker, these markers can allow UniMap Marker to have ID's on the marker. I would much appreciate it if one shows how to impliment it in UniGui.

Thank you.

 

leaflet_numbered_markers.css


.leaflet-div-icon {
    background: transparent;
    border: none;
}

.leaflet-marker-icon .number{
    position: relative;
    top: -37px;
    font-size: 12px;
    width: 25px;
    text-align: center;
}


leaflet_numbered_markers.js


L.NumberedDivIcon = L.Icon.extend({
    options: {
    // EDIT THIS TO POINT TO THE  (or your own marker)
    iconUrl: '<%= image_path("leaflet/marker_hole.png") %>',
    number: '',
    shadowUrl: null,
    iconSize: new L.Point(25, 41),
        iconAnchor: new L.Point(13, 41),
        popupAnchor: new L.Point(0, -33),
        /*
        iconAnchor: (Point)
        popupAnchor: (Point)
        */
        className: 'leaflet-div-icon'
    },

    createIcon: function () {
        var div = document.createElement('div');
        var img = this._createImg(this.options['iconUrl']);
        var numdiv = document.createElement('div');
        numdiv.setAttribute ( "class", "number" );
        numdiv.innerHTML = this.options['number'] || '';
        div.appendChild ( img );
        div.appendChild ( numdiv );
        this._setIconStyles(div, 'icon');
        return div;
    },

    //you could change this to add a shadow like in the normal marker if you really wanted
    createShadow: function () {
        return null;
    }
});


usage.js
//Note that the text could also be letters instead of numbers if that's more appropriate
var marker = new L.Marker(new L.LatLng(0, 0), {
    icon:    new L.NumberedDivIcon({number: '1'})
});

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...