Oh i see, sorry, my mistake
It works now
But i have an other question:)
*This is the x_dempont.php:*
/<?php
// prevent XSS
if (isset($_REQUEST['_SESSION'])) exit();
session_start();
require_once($_SESSION['PM_INCPHP'] . "/globals.php");
require_once($_SESSION['PM_INCPHP'] . "/common.php");
$layer = $map->getLayerByName('sde');
if (!isset($_SESSION['pluginsConfig']['dempont'])) {
pm_logDebug(0, "P.MAPPER-ERROR: Configuration under
'<pluginsConfig><coordinates>' is missing. Check your config.xml file.");
return false;
}
$DemeterCfg = $_SESSION['pluginsConfig']['dempont'];
$demfunctions = $DemeterCfg['demfunctions'];
$demfunction_name = _p($demfunctions['name']);
if ($layer->getNumResults() == 1) {
$res = $layer->getResult(0);
$layer->open();
$shape = $layer->getFeature($res->shapeindex, $res->tileindex);
$id = $shape->ID;
$layer->close();
}
ini_set("soap.wsdl_cache_enabled", 0);
$client = new SoapClient('http://1xx.6.xx.xx:xxxxx/something?wsdl');
$dempont = $client->__soapCall("Dempont_altfoldmin_rtid", array($id));
$dempont = round($dempont);
$DempontJson = "[";
$DempontJson .= "{\"DemFunctionName\": \"$demfunction_name\",
\"dempont\": $dempont,";
$DempontJson = substr($DempontJson, 0, -1) . "]";
header("Content-Type: text/plain; charset=$defCharset");
// return JS object literals "{}" for XMLHTTP request
echo "{\"DempontJson\": $DempontJson}";
?>
/*And this is the js file:*
$.extend(PM.Map,
{
/**
* Sample script for custom actions/modes
* called from mapserver.js/zoombox_apply()
* must be named '*_start(imgxy)'
*/
dempont_start: function(imgxy) {
PM.Plugin.Dempont.openDempontBox(imgxy);
},
dempont_click: function() {
PM.Map.mode = 'dempont';
PM.Map.maction = 'click';
PM.Map.tool = 'dempont';
// define the cursor
if (PM.useCustomCursor) {
PM.setCursor(false, 'crosshair');
}
}
});
$.extend(PM.Plugin,
{
Dempont:
{
options: {css:{width:280}},
/**
* Dempont megjelenitö fv.
*/
openDempontBox: function(imgxy) {
var pixccoords = imgxy.split('+');
var pixX = pixccoords[0];
var pixY = pixccoords[1];
var mpoint = PM.ZoomBox.getGeoCoords(pixX, pixY, false);
$.ajax({
url: PM_PLUGIN_LOCATION + '/dempont/x_dempont.php?' +
SID + '&x=' + mpoint.x + '&y=' + mpoint.y,
dataType: "json",
success: function(response){
var res = response.DempontJson;
var restab = $('<table>');
$.each(res, function(i, n){
restab.append(($('<tr>').append($('<td>').html(n.DemFunctionName))
.append($('<td>').html('Érték: ' + n.dempont))));
});
var container =
$('#pmPluginCoordsDisplay').is(':visible') ?
$('#pmPluginCoordsDisplay') :
$('<div>').id('pmPluginCoordsDisplay')
.addClass('pm-map-link')
.addClass('pm-coordinates-dialog')
.css(PM.Plugin.dempont.options.css)
.appendTo('.ui-layout-center');
container.html('')
.html(_p('Dempont'))
.append(restab)
.append($('<img src="images/close.gif"
alt="close" />').click(function ()
{$(this).parent().remove();}).css('cursor','pointer'))
.show();
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert('Hiba, Nem számolok neked!');
}
});
}
}
});
The error is according to firebug:
|Nem sikerült betölteni a
forrást::http://localhost/demetermap/demeter/plugins/dempont/x_dempont.php||?&x=504980.0551259852&y=183956.28868959998
Cant Load the sourcehttp://...
|
Maybe this is not the only problem,
Am i write the getfeatures function right? Beacuse i think all values
in the ID column will be in the $id variable? How can i make it to get
only the clicked shape's ID form the ID column?
Thanks,
Zsolt
2010.03.26. 16:27 keltezéssel, Thomas Raffin írta:
> Hi,
>
> I agree with you and think this wiki page is the old documentation.
>
> Maybe this on could help you :
> http://svn.pmapper.net/trac/wiki/PluginsMap#Coordinatestranslation
>
> Medve Zsolt a écrit :
>> Hy!
>> I need some help with the plugin.
>> This is the readme file for coordinates plugin:
>>
>> /Enable the plugin by adding a line in config_default.xml file
>> below the tag <pmapper>
>>
>> <plugins>coordinates</plugins>
>>
>> In the same file define the projections you would like to display
>> under the tag <pluginsConfig> with an entry like the following:
>>
>> <coordinates>
>> <mapPrj name="ETRS LAEA" roundTo="0">
>> </mapPrj>
>> <prj name="lat/lon WGS84" roundTo="4">
>> <definition>init=epsg:4326</definition>
>> </prj>
>> <prj name="UTM32" roundTo="0">
>> <definition>init=epsg:32632</definition>
>> </prj>
>> </coordinates>
>>
>> All listed tags and attributes are mandatory.
>>
>> /I do it all,but when i click on the toolbar icon, it dont work.
>> Or i dont know, sometimes it works because i get the crosshair when i
>> click on it, but i dont no why after some try it is stop working..
>> The click dont start the plugin..
>>
>> this is my js_config.php: {tool:'coordinates',
>> name:'coordinates'},
>>
>> http://svn.pmapper.net/trac/wiki/FaqCustomizations#Plugins
>> I read this documentation, but i think its write down the solution
>> for older p.mapper. ... a bit confusing description...
>>
>> Can you help me?
>>
>> Thanks,
>> Zsolt
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> pmapper-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
>>
>>
>>
>>
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users