Package org.wicketstuff.openlayers.api

Examples of org.wicketstuff.openlayers.api.Marker


  public MapWithMarkersAndPopupsInteractionPage(final PageParameters parameters)
  {

    OpenLayersMap openLayersMap = new OpenLayersMap("map", true);
    add(openLayersMap);
    Marker marker = new Marker(new SphericalMercatorLonLat(50, 50), new PopupPanel("Hello Marker 1"));
    openLayersMap.addOverlay(marker);

    WebMarkupContainer popupClicker = new WebMarkupContainer("openPop1");

    popupClicker.add(new PopupMarkerInfoAttributeAppender("onClick", ";", marker, openLayersMap));

    add(popupClicker);

    marker = new Marker(new SphericalMercatorLonLat(100, 50), new PopupPanel("Hello Marker 2"));
    openLayersMap.addOverlay(marker);
    popupClicker = new WebMarkupContainer("openPop2");

    popupClicker.add(new PopupMarkerInfoAttributeAppender("onClick", ";", marker, openLayersMap));
View Full Code Here


    return markerList.get(uniqKey);
  }

  public void removeMarker(String uniqKey)
  {
    Marker remove = markerList.remove(uniqKey);
    if (remove != null && map != null)
    {
      map.removeOverlay(remove);
    }
  }
View Full Code Here

  private String getJsOverlay(Overlay overlay)
  {
    String jsToRun = overlay.getJSadd(this) + "\n";
    if (overlay instanceof Marker)
    {
      Marker marker = (Marker)overlay;
      // if marker has popup and there are no events attached then attach
      // default listener
      if (marker.getPopup() != null &&
        (marker.getEvents() == null || marker.getEvents().length == 0))
      {
        // add mousedown listener!
        marker.addEvent(EventType.mousedown);
      }
      // TODO add listeners
      if (marker.getIcon() != null)
      {
        // prepend icon stuff
        jsToRun = marker.getIcon().getSize().getJSadd() +
          marker.getIcon().getOffset().getJSadd() + marker.getIcon().getJSadd() + jsToRun;
      }
    }
    return jsToRun;
  }
View Full Code Here

  private String getJsOverlay(Overlay overlay)
  {
    String jsToRun = overlay.getJSadd(this) + "\n";
    if (overlay instanceof Marker)
    {
      Marker marker = (Marker)overlay;
      // if marker has popup and there are no events attached then attach
      // default listener
      if (marker.getPopup() != null &&
        (marker.getEvents() == null || marker.getEvents().length == 0))
      {
        // add mousedown listener!
        marker.addEvent(EventType.mousedown);
      }
      // add listeners
      for (EventType evt : marker.getEvents())
      {
        jsToRun += getJSinvoke("addMarkerListener('" + evt.name() + "','" +
          callbackListener.getCallBackForMarker(marker) + "'," +
          marker.getOverlayJSVar() + ")");
      }
      if (marker.getIcon() != null)
      {
        // prepend icon stuff
        jsToRun = marker.getIcon().getSize().getJSadd() +
          marker.getIcon().getOffset().getJSadd() + marker.getIcon().getJSadd() + jsToRun;
      }
    }
    return jsToRun;

  }
View Full Code Here

TOP

Related Classes of org.wicketstuff.openlayers.api.Marker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.