Mittwoch, 4. Juni 2008
Oracle Maps may fully take advantage of the inbuilt Oracle Spatial Technology as part of the database. The functions ANYINTERACT and/or SDO_RELATE are used to calculate above e.g. which FOI (customer) is located in the Polygon (REGIERUNGSBEZIRK = County).
When you click ('mouse_click') on the polygon the Spatial Function is invoked and no timeconsuming calculations are carried out - and you have the result within a second.
A mouse_click listener is registered to the map.
and invokes by means of the 2nd parameter "showSelection" the function below:
This listener adds two themes to display the selected county and customers inside it. Both themes take the mouse click location as the geometry binding parameter.
var countyTheme = null ;
var customerTheme = null ;
var mouseLoc = mapview.getMouseLocation();
countyTheme = new MVThemeBasedFOI('themebasedfoi1','geo.de_regbez_selected_by_click') ;
customerTheme = new MVThemeBasedFOI('themebasedfoi2','geo.de_kunden_in_selected_county') ;
Enabling the above code to work we have to define two themes based on respective tables (for my example REGBEZ and DEKUNDEN or in the MVDEMO * schema: COUNTIES and CUSTOMERS):
1. de_regbez_selected_by_click (for the MVDEMO schema: counties_selected_by_click)
2. de_kunden_in_selected_county (for the MVDEMO schema: customers_in_selected_counties)
and put some code and SQL in the style definitions (we do use the Mapbuilder:)
1. Theme "DE_REGBEZ_SELECTED_BY_CLICK" - we select the polygon by click:
The code within style of theme "DE_REGBEZ_SELECTED_BY_CLICK":
(sdo_relate(geoloc, :1, 'mask=ANYINTERACT')='TRUE' and rownum >2)
Pls look at the "Features Style"! I have created a feature style of type "Line" and named it "L.DE_NUTS2_SELECTED_YELLOW" and applied it when "Rendering" - so the borders of the county turn out to be highlighted in yellow color when clicked.
2. Theme "DE_KUNDEN_IN_SELECTED_COUNTY":
The Style of the theme "DE_KUNDEN_IN_SELECTED_COUNTY" in detail:
select a.geoloc, a.name, a.regbez, a.umsatz from dekunden a
where SDO_RELATE(a.geoloc,(select geoloc from de_nuts2 b where sdo_contains(b.geoloc, :1)='TRUE' and rownum<2), 'mask=ANYINTERACT'='TRUE'
Admittedly the above code is related to my tables.
Here is the code you may use for the MVDEMO tables "customers" and "counties":
Code for the first theme/style (county_selected_by_click):
(sdo_relate(geom, :1, 'mask=ANYINTERACT')='TRUE' and rownum<2)
Code for the customer theme (customers_in_selected_county):
select a.location, a.name,
a.city, a.sales from customers a where sdo_relate(a.location, (select
geom from counties b where sdo_contains(b.geom, :1)='TRUE' and
* Using MVDEMO data:
"geo.de_kunden_in_selected_county" by "mvdemo.customers_in_selected_county"
Finally I like to thank LJ and Ji of the Oracle Maps Development team for their support in achieving the above! Thanks!
Montag, 7. Mai 2007
<--- in the middle of the 8 arrows you'll fine an additional mark: the HOME-Link
It helps to go back to the HOME settings defined in the respective function
How to achive this ?
See the example code as below:
var baseURL = "http://"+document.location.host+"/mapviewer";
var mapCenterLon = -122.45;
var mapCenterLat = 37.7706;
var mapZoom = 3;
var mpoint = MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,8307);
mapview = new MVMapView(document.getElementById("map"), baseURL);
mapview.addCopyRightNote("©2006 powered by oracle(tm)");
Donnerstag, 3. Mai 2007
Without "programming" and with just little expertise in the "Mapbuilder" and in "Oracle Maps" this is possible:
1 Basemap mit counties and sub-districts
5 FOI layers:
- customers with sales
- counties "Freistaaten" (lightgreen-transparent),
- other counties (green, transparent),
- Hansestadt Hamburg (yellow)
- APEX Selectlist: customer sales styles: variable points and bars
Cooming soon: "How To Tipps".....
Freitag, 20. April 2007
when experiencing performance issues consider this:
The more FOIs you display, the higher the overhead in the client browser.
The solution is to limit the number of FOIs to be displayed based on the zoom level.
Check out methods like:
This sets the minimum zoom level at which FOIs become visible. Above that level, the FOIs are not shown at all.
This sets the level up to which FOIs are rendered as a
single image, so consuming less resources in the browser. After that level, they are rendered as individual images.
This sets the level from which the FOIs are clickabke. Above that level, they are visible but not clickable. Check also
By setting this to 1, Mapviewer will only return those FOIs that strictly fit in the current map window. The default it 2, which means that Mapviewer returns FOIs that fit twice the area.
Thanks to Albert Godfrind for pointing me to this !
An example will follow as soon as I have tested this ! stay tuned !